Browse Source

按文档修改

beijing
陈鹏飞 3 years ago
parent
commit
5ce810cb84
  1. 6
      src/app/pages/license/file-category/file-category.component.html
  2. 17
      src/app/pages/license/file-category/file-category.component.ts
  3. 2
      src/app/pages/license/update-category/edit-update-category/edit-update-category.component.html
  4. 9
      src/app/pages/license/update-category/update-category.component.html
  5. 34
      src/app/pages/license/update-category/update-category.component.ts

6
src/app/pages/license/file-category/file-category.component.html

@ -4,8 +4,8 @@
[nzShowPagination]="false" [nzScroll]="{ y:tableScrollHeight }" [nzNoResult]='null' nzTableLayout="fixed"> [nzShowPagination]="false" [nzScroll]="{ y:tableScrollHeight }" [nzNoResult]='null' nzTableLayout="fixed">
<thead> <thead>
<tr> <tr>
<th [nzWidth]="'16%'"> <th [nzWidth]="'45%'">
<span style="margin-left: 25%;">证照名称</span> <span style="margin-left: 10%;">证照名称</span>
</th> </th>
<th>有无证照</th> <th>有无证照</th>
<!-- <th>提交时间</th> <!-- <th>提交时间</th>
@ -17,7 +17,7 @@
<tbody id="table"> <tbody id="table">
<tr *ngFor="let item of headerTable.data;let key = index"> <tr *ngFor="let item of headerTable.data;let key = index">
<td> <td>
<span style="margin-left: 25%;">{{item.licenseTypeName || ''}}</span> <span style="margin-left: 10%;">{{item.licenseTypeName || ''}}</span>
</td> </td>
<td> <td>
<span *ngIf="item.validatyType == 0">不适用</span> <span *ngIf="item.validatyType == 0">不适用</span>

17
src/app/pages/license/file-category/file-category.component.ts

@ -120,22 +120,27 @@ export class FileCategoryComponent implements OnInit {
this.message.create('warning', '请上传附件!'); this.message.create('warning', '请上传附件!');
return false; return false;
} }
await new Promise(resolve => { if (instance.validatyType != '2' && !instance.data2.remark) {
this.message.create('warning', '请填写完整!');
return false;
}
instance.data2.validatyType = Number(instance.validatyType) instance.data2.validatyType = Number(instance.validatyType)
this.http.post('/api/services/app/StationFileLicense/Create', instance.data2).subscribe((data: any) => {
if (!instance.isSubmit) { if (!instance.isSubmit) {
resolve(data); this.http.post('/api/services/app/StationFileLicense/Create', instance.data2).subscribe((data: any) => {
this.getStationList(); this.getStationList();
this.message.create('success', '修改成功!'); this.message.create('success', '修改成功!');
return true; })
} else { //提交审核 return false;
} else {
await new Promise(resolve => {
this.http.post('/api/services/app/StationFileLicense/Create', instance.data2).subscribe((data: any) => {
this.submitReview(data.result).then(res=>{ this.submitReview(data.result).then(res=>{
resolve(data); resolve(data);
return true; return true;
}); });
}
}) })
}) })
} //else
} }
}); });
const instance = modal.getContentComponent(); const instance = modal.getContentComponent();

2
src/app/pages/license/update-category/edit-update-category/edit-update-category.component.html

@ -58,7 +58,7 @@
<img *ngIf="data2.attachment && getFileType(data2.attachment) == 'pdf'" src="../../../../assets/images/license/pdf.png" (click)="lookFile(data2.attachment)"> <img *ngIf="data2.attachment && getFileType(data2.attachment) == 'pdf'" src="../../../../assets/images/license/pdf.png" (click)="lookFile(data2.attachment)">
<input *ngIf="!data2.attachment" (change)="filechange($event,false)" class="fileinput" type="file" name="" id=""> <input *ngIf="!data2.attachment" (change)="filechange($event,false)" class="fileinput" type="file" name="" id="">
<button *ngIf="!data2.attachment" nz-button [nzLoading]="isLoadingSave"><i nz-icon nzType="upload" nzTheme="outline"></i>上传副本</button> <button *ngIf="!data2.attachment" nz-button [nzLoading]="isLoadingSave">上传附件副本</button>
</div> </div>
<div class="uploadDiv" *ngIf="data2.attachment && data2.hasAttachmentDefault"> <div class="uploadDiv" *ngIf="data2.attachment && data2.hasAttachmentDefault">
<input (change)="filechange($event,false)" class="fileinput" type="file" name="" id=""> <input (change)="filechange($event,false)" class="fileinput" type="file" name="" id="">

9
src/app/pages/license/update-category/update-category.component.html

@ -49,8 +49,13 @@
</td> </td>
<td> <td>
<img *ngIf="item.imageUrl && getFileType(item.imageUrl) == 'img'" [src]="item.imageUrl" (click)="viewImg(item.imageUrl)"> <img *ngIf="item.imageUrl && getFileType(item.imageUrl) == 'img'" [src]="item.imageUrl" (click)="viewImg(item.imageUrl)">
<img *ngIf="item.imageUrl && getFileType(item.imageUrl) == 'word'" src="../../../../assets/images/license/word.png" (click)="lookFile(item)"> <img *ngIf="item.imageUrl && getFileType(item.imageUrl) == 'word'" src="../../../../assets/images/license/word.png" (click)="lookFile(item.imageUrl)">
<img *ngIf="item.imageUrl && getFileType(item.imageUrl) == 'pdf'" src="../../../../assets/images/license/pdf.png" (click)="lookFile(item)"> <img *ngIf="item.imageUrl && getFileType(item.imageUrl) == 'pdf'" src="../../../../assets/images/license/pdf.png" (click)="lookFile(item.imageUrl)">
<label *ngIf="item.attachment && item.hasAttachmentDefault" style="margin-left: 10px;">
<img *ngIf="item.attachment && getFileType(item.attachment) == 'img'" [src]="item.attachment" (click)="viewImg(item.attachment)">
<img *ngIf="item.attachment && getFileType(item.attachment) == 'word'" src="../../../../assets/images/license/word.png" (click)="lookFile(item.attachment)">
<img *ngIf="item.attachment && getFileType(item.attachment) == 'pdf'" src="../../../../assets/images/license/pdf.png" (click)="lookFile(item.attachment)">
</label>
</td> </td>
<td class="operation"> <td class="operation">
<span class="blueColor" (click)="edit(item)">编辑</span> <span class="blueColor" (click)="edit(item)">编辑</span>

34
src/app/pages/license/update-category/update-category.component.ts

@ -93,15 +93,15 @@ export class UpdateCategoryComponent implements OnInit {
//查看文件 //查看文件
lookFile(item) { lookFile(item) {
if (!item.imageUrl) { if (!item) {
return return
} }
if (this.getFileType(item.imageUrl) == 'word') { if (this.getFileType(item) == 'word') {
let arr = item.imageUrl.split('.') let arr = item.split('.')
arr[arr.length - 1] = 'pdf' arr[arr.length - 1] = 'pdf'
window.open(arr.join('.')) window.open(arr.join('.'))
} else if (this.getFileType(item.imageUrl) == 'pdf') { } else if (this.getFileType(item) == 'pdf') {
window.open(item.imageUrl) window.open(item)
} else { } else {
this.message.create('warning', '暂不支持查看!'); this.message.create('warning', '暂不支持查看!');
} }
@ -133,33 +133,41 @@ export class UpdateCategoryComponent implements OnInit {
nzFooter: null, nzFooter: null,
nzClosable: false, nzClosable: false,
nzOnOk: async () => { nzOnOk: async () => {
if (!instance.data2.imageUrl) {
this.message.create('warning', '请上传附件!');
return false;
}
if (instance.data2.hasAttachmentDefault && !instance.data2.attachment) {
this.message.create('warning', '请上传附件副本!');
return false;
}
if (instance.validateForm.valid) { if (instance.validateForm.valid) {
await new Promise(resolve => {
let body = instance.data2 let body = instance.data2
// 日期
if (body.isLongTerm) { if (body.isLongTerm) {
body.validityStartTime = instance.isLongTermTime || new Date() body.validityStartTime = instance.isLongTermTime || new Date()
} else { } else {
body.validityStartTime = instance.isNoLongTermTime[0] || new Date() body.validityStartTime = instance.isNoLongTermTime[0] || new Date()
body.validityEndTime = instance.isNoLongTermTime[1] || new Date() body.validityEndTime = instance.isNoLongTermTime[1] || new Date()
} }
this.http.post('/api/services/app/StationValidityLicense/Create', body).subscribe((data:any) => {
if (!instance.isSubmit) { if (!instance.isSubmit) {
resolve(data); this.http.post('/api/services/app/StationValidityLicense/Create', body).subscribe((data:any) => {
this.getStationList(); this.getStationList();
this.message.create('success', '修改成功!'); this.message.create('success', '修改成功!');
return true; })
} else { //提交审核 return false;
} else {
await new Promise(resolve => {
this.http.post('/api/services/app/StationValidityLicense/Create', body).subscribe((data:any) => {
this.submitReview(data.result).then(res=>{ this.submitReview(data.result).then(res=>{
resolve(data); resolve(data);
return true; return true;
}); });
}
}) })
}) })
} //else
} else { } else {
this.message.create('warning', '请填写完整!'); this.message.create('warning', '请填写完整!');
return false return false;
} }
} }
}); });

Loading…
Cancel
Save