frontdesk/src/app/app.module.ts
@@ -6,6 +6,8 @@ import { TranslateHttpLoader } from '@ngx-translate/http-loader'; import { AppComponent } from './app.component'; import { HttpService } from './service/common/http.service'; import { ListSort } from './service/common/listSort.service'; import { TemporaryCache } from './service/common/temporaryCache.service'; import { CookieService } from './service/common/cookie.service'; import { CoreModule } from './core/core.module'; import { LayoutModule } from './layout/layout.module'; @@ -48,6 +50,8 @@ providers: [ {provide: LocationStrategy,useClass: HashLocationStrategy}, HttpService, ListSort, TemporaryCache, CookieService, AddressService, OrgDataService frontdesk/src/app/routes/filearchives/archives/archive.component.html
@@ -431,7 +431,7 @@ <div bsModal #smModal="bs-modal" class="modal fade in" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="false" [config]="{backdrop: 'static',keyboard:false}"> <div class="modal-dialog " style="width: 1000px;white-space:nowrap; "> <div class="modal-dialog " style="width: 1000px;white-space:nowrap;"> <div class="modal-content"> <div class="modal-body"> <div class="row" style="margin-left: 10px;margin-right: 10px;"> frontdesk/src/app/routes/filearchives/upvolume/upvolume.component.html
@@ -135,7 +135,7 @@ </div> <div bsModal #archiveDetailModal="bs-modal" id="archiveDetailModal" class="modal fade in" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="false" [config]="{backdrop: 'static',keyboard:false}"> <div class="modal-dialog " style="width: 1000px;white-space:nowrap; "> <div class="modal-dialog " style="width: 1000px;white-space:nowrap;margin-top: 350px"> <div class="modal-content"> <em class="fa fa-times" style="margin-left:98%" (click)="archiveModalCloseById(archiveDetailModal,'archiveDetailModal')" aria-hidden="true"></em> <div class="modal-body"> frontdesk/src/app/service/common/listSort.service.ts
New file @@ -0,0 +1,57 @@ import { Injectable } from '@angular/core'; @Injectable() export class ListSort { groupingSort(list:any){ let relationListX = list; let destX:any; let newRelationListX = []; let noRelationListX = []; newRelationListX = relationListX.filter(x => x.AccountVoucherNumber); let map = {}, dest = []; for(var i = 0; i < newRelationListX.length; i++){ var ai = newRelationListX[i]; if(!map[ai.AccountVoucherNumber]){ dest.push({ AccountVoucherNumber: ai.AccountVoucherNumber, CREATE_DATE: ai.CREATE_DATE, ServiceNumber: ai.ServiceNumber, Accounting: ai.Accounting, FinanceDirector: ai.FinanceDirector, Cashier: ai.Cashier, ToReview: ai.ToReview, data: [ai] }); map[ai.AccountVoucherNumber] = ai; }else{ for(var j = 0; j < dest.length; j++){ var dj = dest[j]; if(dj.AccountVoucherNumber === ai.AccountVoucherNumber){ dj.data.push(ai); break; } } } } function sortNumber(a: any,b: any){return parseInt(a.AccountVoucherNumber) - parseInt(b.AccountVoucherNumber)} destX = dest.sort(sortNumber); newRelationListX = []; noRelationListX = relationListX.filter(x => !x.AccountVoucherNumber); if(noRelationListX.length!=0){ destX.push({ AccountVoucherNumber: "", CREATE_DATE: "", ServiceNumber: "", Accounting: "", FinanceDirector: "", Cashier: "", ToReview: "", data:noRelationListX }) } console.log(noRelationListX); console.log(destX); return destX } } frontdesk/src/app/service/common/temporaryCache.service.ts
New file @@ -0,0 +1,29 @@ import { Injectable } from '@angular/core'; import { Subject } from 'rxjs'; @Injectable() export class TemporaryCache { private tcdeStatas = new Subject<string>(); tcStatas$ = this.tcdeStatas.asObservable(); tC = []; archiveData; tcSave(data){ this.tC.push(data); }; tcGet(keys){ if(keys!=undefined){ for(let i=0;i<this.tC.length;i++){ if(this.tC[i].key === keys){ return this.tC[i].value; } } } }; tcCall(archiveData){ if(archiveData!=undefined){ this.archiveData = archiveData; } this.tcdeStatas.next(this.archiveData); }; } frontdesk/src/app/shared/components/arrangementDetails/arrangementDetails.component.html
@@ -10,6 +10,7 @@ <th class="text-center">申请人</th> <th class="text-center">申请人部门</th> <th class="text-center">调整实物</th> <th class="text-center">调整理由</th> </tr> </thead> <tbody style="height:auto; display:inline;"> @@ -18,15 +19,6 @@ <td class="text-center">{{reason.arrangementStaff}}</td> <td class="text-center">{{reason.orgValue}}</td> <td class="text-center"><span *ngIf="reason.materialObjectFlg">是</span><span *ngIf="!reason.materialObjectFlg">否</span></td> </tr> </tbody> <thead class="text-center"> <tr> <th class="text-center">调整理由</th> </tr> </thead> <tbody style="height:auto; display:inline;"> <tr> <td class="text-center">{{reason.reason == '' ? '无' : reason.reason}}</td> </tr> </tbody> @@ -74,24 +66,18 @@ <thead class="text-center"> <tr> <th class="text-center">说明</th> <ng-container *ngFor="let item of colList"> <th class="text-center">{{item.colName}}</th> </ng-container> <th class="text-center">调整前</th> <th class="text-center">调整后</th> </tr> </thead> <tbody style="height:auto; display:inline;"> <tr> <td class="text-center">调整前</td> <ng-container *ngFor="let col of colList"> <td class="text-center">{{volumeDetail.oldVolumeDetail[col.colId]}}</td> </ng-container> </tr> <tr> <td class="text-center">调整后</td> <ng-container *ngFor="let col of colList"> <td class="text-center">{{volumeDetail.newVolumeDetail[col.colId]}}</td> </ng-container> </tr> <ng-container *ngFor="let item of colList"> <tr *ngIf="volumeDetail.oldVolumeDetail[item.colId]!==undefined || volumeDetail.newVolumeDetail[item.colId]!==undefined"> <td class="text-center">{{item.colName}}</td> <td class="text-center">{{volumeDetail.oldVolumeDetail[item.colId]}}</td> <td class="text-center">{{volumeDetail.newVolumeDetail[item.colId]}}</td> </tr> </ng-container> </tbody> </table> </div> frontdesk/src/app/shared/components/arrangementDetails/arrangementDetails.component.ts
@@ -125,10 +125,16 @@ const data = newVolumeDetail.find(newData => newData.metadataId === oldData.metadataId && newData.value !== oldData.value); if (data !== undefined) { this.colList.push({colName: data.chineseName, colId: data.englishName}); var obj = {}; this.colList = this.colList.reduce(function(item, next) { obj[next.colName] ? '' : obj[next.colName] = true && item.push(next) return item }, []); this.volumeDetail.newVolumeDetail[data.englishName] = data.value; this.volumeDetail.oldVolumeDetail[data.englishName] = oldData.value; } }); console.log(this.volumeDetail); } analysisArchiveData(archive, key) { frontdesk/src/app/shared/components/showArchiveParts/showArchiveParts.component.html
@@ -13,17 +13,17 @@ <a *ngIf="fileList!==undefined && fileList.length!== 0"><font color="black">档案附件</font></a> </li> <li *ngIf="updateFileFlg&&fileAdjustmentList.length" (click)="changeDetailStep(6)" [ngClass]="{'active': detailStep===3}"> <li *ngIf="updateFileFlg" (click)="changeDetailStep(6)" [ngClass]="{'active': detailStep===3}"> <a ><font color="black">调整档案附件</font></a> </li> <li *ngIf=" dataList.length >0" (click)="changeDetailStep(4)" [ngClass]="{'active': detailStep===4}"> <li *ngIf=" dataList.length >0 && !updateFileFlg" (click)="changeDetailStep(4)" [ngClass]="{'active': detailStep===4}"> <a >关联档案</a> </li> <li *ngIf="interfaceType==='005' && dataList!== undefined && dataList.length !== 0" (click)="changeDetailStep(5)" [ngClass]="{'active': detailStep===5}"> <li *ngIf="interfaceType==='005' && dataList!== undefined && dataList.length !== 0 && !updateFileFlg" (click)="changeDetailStep(5)" [ngClass]="{'active': detailStep===5}"> <a >云尚行凭证</a> </li> <li *ngIf="interfaceType==='006' && dataList!== undefined && dataList.length !== 0" (click)="changeDetailStep(5)" [ngClass]="{'active': detailStep===5}"> <li *ngIf="interfaceType==='006' && dataList!== undefined && dataList.length !== 0 && !updateFileFlg" (click)="changeDetailStep(5)" [ngClass]="{'active': detailStep===5}"> <a >云尚行凭证</a> </li> </ul> @@ -133,43 +133,100 @@ </div> </div> <br> <div class="table-head"> <ng-container *ngFor="let row of blockList"> <div class="row"> <ng-container *ngFor="let col of row"> <div class="col-md-3 item"> <span>{{col.chineseName}}:</span> <span>{{col.value}}</span> </div> </ng-container> <ng-container *ngIf="interfaceType!=='005'"> <div class="table-head"> <ng-container *ngFor="let row of blockList"> <div class="row"> <ng-container *ngFor="let col of row"> <div class="col-md-3 item"> <span>{{col.chineseName}}:</span> <span>{{col.value}}</span> </div> </ng-container> </div> </ng-container> </div> <div class="table-responsive" style="border-top:1px solid #f1f1f1;border-bottom:1px solid #f1f1f1"> <table class="table"> <thead> <tr> <ng-container *ngFor="let colName of col"> <th rowspan="2" > {{colName}}</th> </ng-container> </tr> </thead> <tbody> <tr *ngFor="let data of relationList"> <ng-container *ngFor="let keyName of colId"> <td > {{data[keyName]}}</td> </ng-container> </tr> </tbody> </table> </div> <div class="row myfooter"> <ng-container *ngFor="let low of lowBlockList"> <div class="col-md-2 text-center"> {{low.chineseName}}:{{low.value}} </div> </ng-container> </div> <div class="table-responsive" style="border-top:1px solid #f1f1f1;border-bottom:1px solid #f1f1f1"> <table class="table"> <thead> <tr> <ng-container *ngFor="let colName of col"> <th rowspan="2" > {{colName}}</th> </ng-container> </tr> </thead> <tbody> <tr *ngFor="let data of relationList"> <ng-container *ngFor="let keyName of colId"> <td > {{data[keyName]}}</td> </ng-container> </tr> </tbody> </table> </div> <div class="row myfooter"> <ng-container *ngFor="let low of lowBlockList"> <div class="col-md-2 text-center"> {{low.chineseName}}:{{low.value}} </ng-container> </div> </ng-container> <ng-container *ngIf="interfaceType==='005'"> <ng-container *ngFor="let items of destX"> <div class="table-head"> <ng-container *ngFor="let row of blockList"> <div class="row"> <ng-container *ngFor="let col of row"> <div class="col-md-3 item"> <span>{{col.chineseName}}:</span> <span *ngIf="col.chineseName!=='记账凭证编号' && col.chineseName!=='服务订单号' && col.chineseName!=='记账日期'" >{{col.value}}</span> <span *ngIf="col.chineseName==='记账凭证编号'" >{{items.AccountVoucherNumber}}</span> <span *ngIf="col.chineseName==='服务订单号'" >{{items?.ServiceNumber}}</span> <span *ngIf="col.chineseName==='记账日期'" >{{items?.CREATE_DATE | date:'yyyy/M/d'}}</span> </div> </ng-container> </div> </ng-container> </div> <div class="table-responsive" style="border-top:1px solid #f1f1f1;border-bottom:1px solid #f1f1f1"> <table class="table"> <thead> <tr> <ng-container *ngFor="let colName of col"> <th rowspan="2" > {{colName}}</th> </ng-container> </tr> </thead> <tbody> <tr *ngFor="let data of items.data"> <ng-container *ngFor="let keyName of colId"> <td > {{data[keyName]}}</td> </ng-container> </tr> </tbody> </table> </div> <div class="row myfooter"> <ng-container *ngFor="let low of lowBlockList"> <div class="col-md-2 text-center"> <ng-container *ngIf="low.chineseName==='财务主管'" > {{low.chineseName}}:{{items?.FinanceDirector}} </ng-container> <ng-container *ngIf="low.chineseName==='复核'" > {{low.chineseName}}:{{items?.ToReview}} </ng-container> <ng-container *ngIf="low.chineseName==='记账会计'" > {{low.chineseName}}:{{items?.Accounting}} </ng-container> <ng-container *ngIf="low.chineseName==='出纳'" > {{low.chineseName}}:{{items?.Cashier}} </ng-container> </div> </ng-container> </div> </ng-container> </div> </ng-container> </div> </div> </div> @@ -180,7 +237,7 @@ <ng-container *ngFor="let item of fileAdjustmentList"> <div class="row"> <ng-container *ngIf="item.dataType === '11' "> <uploadfile [data]="item" [adjustmentFlg]="true" (addFile)="emitFileData($event,'add')" (deleteFile)="emitFileData($event,'delete')" ></uploadfile> <uploadfile [tcData]="archiveData.archiveCode" [data]="item" [adjustmentFlg]="true" (addFile)="emitFileData($event,'add')" (deleteFile)="emitFileData($event,'delete')" ></uploadfile> </ng-container> </div> <div class="row"> frontdesk/src/app/shared/components/showArchiveParts/showArchiveParts.component.ts
@@ -1,9 +1,11 @@ import { Component, OnInit, Input, SimpleChanges, OnChanges, Output, EventEmitter } from '@angular/core'; import { HttpService } from '../../../service/common/http.service'; import { ListSort } from '../../../service/common/listSort.service'; import { TemplateUtil } from '../../util/templateUtil'; import { commonTools } from '../../modules/commonTools'; import { UrlUtil } from '../../util/urlUtil'; import { element } from 'protractor'; import { TemporaryCache } from '../../../service/common/temporaryCache.service'; const swal = require('sweetalert'); const config = require('../../../../assets/json/cloudVoucher.json'); @@ -77,6 +79,7 @@ colId = []; relationList = []; relationListX = []; voucherCol = config.voucherCol; @@ -92,8 +95,9 @@ deleteFileIds = []; addFileIds = []; destX: any = []; constructor(private templateUtil: TemplateUtil, private httpService: HttpService, private urlUtil: UrlUtil) {} constructor(private templateUtil: TemplateUtil, private httpService: HttpService, private urlUtil: UrlUtil,private listSort: ListSort,private TemporaryCache: TemporaryCache) {} ngOnInit(): void {} @@ -144,8 +148,6 @@ this.archiveData = archiveData; this.getInterfaceType(); this.detailList = this.getArchiveDetail(this.archiveData); if (this.interfaceType === '005') { const data = []; this.lowBlockList = []; @@ -165,7 +167,15 @@ } }); }); this.blockList = this.splitMateDate(4, data); if(this.lowBlockList.length === 0){ this.lowBlockList.push( {chineseName:"财务主管"}, {chineseName:"复核"}, {chineseName:"记账会计"}, {chineseName:"出纳"}, ); } this.blockList = this.splitMateDate(3, data); } this.headCol.forEach(key => @@ -181,7 +191,7 @@ getArchiveDetail(data): any[] { let dataList = []; this.errFlg = false; this.fileAdjustmentList = []; //this.fileAdjustmentList = []; this.httpService.xhrPost(this.httpService.selectMetaDataByArchiveCodeRApi, {condition: data} , (res) => { if (res.data === undefined) { this.errFlg = true; @@ -210,7 +220,6 @@ this.fileflg = false; this.fileList = []; this.httpService.post(this.httpService.selectArciveFile, {'fileCode': fileCode}, (res) => { console.log(res); if (res.data !== undefined && res.data.length !== 0 ) { this.fileflg = true; this.fileList = res.data; @@ -230,13 +239,24 @@ list.push(file); } }); this.fileAdjustmentList.push({ metadataId: element.metadataId, chineseName: element.chineseName, englishName: element.englishName, dataType: dataType, uploadedFileList: list, }); if(this.fileAdjustmentList === []){ this.fileAdjustmentList.push({ metadataId: element.metadataId, chineseName: element.chineseName, englishName: element.englishName, dataType: dataType, uploadedFileList: list, }); }else{ this.fileAdjustmentList = []; this.fileAdjustmentList.push({ metadataId: element.metadataId, chineseName: element.chineseName, englishName: element.englishName, dataType: dataType, uploadedFileList: list, }); } } // 密集 @@ -264,6 +284,9 @@ changeDetailStep(step): void { this.detailStep = step; if(step === 6){ this.TemporaryCache.tcCall(this.archiveData); }; } relationAchive(pageProperty): void { @@ -348,10 +371,11 @@ } getCol(dataList) { const data = this.getArchiveDetail({ const getDatalist = { 'archiveCode': dataList[0].archiveCode, 'templetSetId': dataList[0].templetSetId }); }; const data = this.getArchiveDetail(getDatalist); this.col = []; this.colId = []; data.forEach(element => { @@ -373,6 +397,7 @@ 'codes': dataList.map(element => element.archiveCode) }, (res) => { this.relationList = res.data.data; this.destX = this.listSort.groupingSort(res.data.data); }); } frontdesk/src/app/shared/components/uploadfile/uploadfile.component.ts
@@ -4,6 +4,7 @@ import { HttpService } from '../../../service/common/http.service'; import { UrlUtil } from '../../../shared/util/urlUtil'; import { Http } from '@angular/http'; import { TemporaryCache } from '../../../service/common/temporaryCache.service'; declare var $: any; const swal = require('sweetalert'); @@ -46,7 +47,7 @@ addFileList: [], value: '' }; @Input()tcData; title = '文件上传'; descript = ''; @@ -63,7 +64,17 @@ private httpService: HttpService, private http: Http, private urlUtil: UrlUtil, ) {} private TemporaryCache: TemporaryCache, ) { this.TemporaryCache.tcStatas$.subscribe( () => { const tcValue = this.TemporaryCache.tcGet(this.tcData); if(this.uploader.files === [] && tcValue!= []){ this.uploader.files = tcValue; } } ); } ngOnInit() { this.uploader = new Resumable({ @@ -74,6 +85,12 @@ throttleProgressCallbacks: 1, chunkSize: 1 * 1024 * 1024 }); if(this.TemporaryCache.tcGet(this.tcData)){ const tcValue = this.TemporaryCache.tcGet(this.tcData); if(this.uploader.files){ this.uploader.files = tcValue; } } this.data.addFileList = []; }; @@ -111,7 +128,7 @@ swal('文件:' + file.fileName + '上传失败!', '请从新上传', 'info'); }; this.httpService.post('uploadservlet/getFastPath', {fileName: file.fileName}, (res) => { if (res.data === undefined || res.data === '') { if (res.data === undefined) { fun(); } else { const data = { @@ -122,9 +139,8 @@ }; this.data.addFileList.push(data); data['fileOrder'] = this.data.uploadedFileList.length + 1; console.log(this.data); this.addFile.emit(data); this.TemporaryCache.tcSave({key:this.tcData,value:this.uploader.files}); swal('文件' + file.fileName + '上传完成', '', 'success'); } }); @@ -303,7 +319,6 @@ } preview(item) { console.log(item); const type = item.fileName.split('.'); const fileType = type[type.length - 1]; let size = 0;