邵佳豪 3 years ago
parent
commit
f0b33b6fd2
  1. 9
      src/app/pages/license/file-category/edit-file-category/edit-file-category.component.html
  2. 5
      src/app/pages/license/file-category/edit-file-category/edit-file-category.component.ts
  3. 2
      src/app/pages/license/update-category/details-update-category/details-update-category.component.html
  4. 36
      src/app/pages/license/update-category/edit-update-category/edit-update-category.component.html
  5. 34
      src/app/pages/license/update-category/edit-update-category/edit-update-category.component.ts
  6. 2
      src/app/pages/license/update-category/update-category.component.html
  7. 2
      src/app/system-management/update-of-license/add-update-of-license/add-update-of-license.component.html
  8. 20
      src/app/system-management/update-of-license/add-update-of-license/add-update-of-license.component.ts
  9. 2
      src/app/system-management/update-of-license/edit-update-of-license/edit-update-of-license.component.html
  10. 16
      src/app/system-management/update-of-license/edit-update-of-license/edit-update-of-license.component.ts
  11. 1
      src/app/system-management/update-of-license/update-of-license.component.ts

9
src/app/pages/license/file-category/edit-file-category/edit-file-category.component.html

@ -31,12 +31,11 @@
<img *ngIf="data2.imageUrl && getFileType(data2.imageUrl) == 'pdf'" src="../../../../assets/images/license/pdf.png" (click)="lookFile(data2)"> <img *ngIf="data2.imageUrl && getFileType(data2.imageUrl) == 'pdf'" src="../../../../assets/images/license/pdf.png" (click)="lookFile(data2)">
<input *ngIf="!data2.imageUrl" (change)="filechange($event)" class="fileinput" type="file" name="" id=""> <input *ngIf="!data2.imageUrl" (change)="filechange($event)" class="fileinput" type="file" name="" id="">
<button *ngIf="!data2.imageUrl" nz-button [nzLoading]=""><i nz-icon nzType="upload" <button *ngIf="!data2.imageUrl" nz-button [nzLoading]="isLoadingSave"><i nz-icon nzType="upload" nzTheme="outline"></i>上传附件</button>
nzTheme="outline"></i>上传附件</button>
</div> </div>
<div class="uploadDiv" *ngIf="data2.imageUrl"> <div class="uploadDiv" *ngIf="data2.imageUrl">
<input (change)="filechange($event)" class="fileinput" type="file" name="" id=""> <input (change)="filechange($event)" class="fileinput" type="file" name="" id="">
<button nz-button [nzLoading]=""><i nz-icon nzType="upload" nzTheme="outline"></i>重新上传</button> <button nz-button [nzLoading]="isLoadingSave"><i nz-icon nzType="upload" nzTheme="outline"></i>重新上传</button>
</div> </div>
</div> </div>
@ -44,8 +43,8 @@
<textarea style="background: #173350;height: 100px;width: 100%;border-radius: 0;border: 0;color: white;" cols="30" rows="10" [(ngModel)]="data2.remark" formControlName="remark"></textarea> <textarea style="background: #173350;height: 100px;width: 100%;border-radius: 0;border: 0;color: white;" cols="30" rows="10" [(ngModel)]="data2.remark" formControlName="remark"></textarea>
<div class="btnbox"> <div class="btnbox">
<button nz-button type="submit" class="ok" (click)="submitReview()">提交审核</button> <button nz-button type="submit" class="ok" (click)="submitReview()" [nzLoading]="isLoadingSave">提交审核</button>
<button nz-button type="submit" class="ok" (click)="ok()">保存</button> <button nz-button type="submit" class="ok" (click)="ok()" [nzLoading]="isLoadingSave">保存</button>
<button nz-button type="button" class="cancel" (click)="destroyModal()">取消</button> <button nz-button type="button" class="cancel" (click)="destroyModal()">取消</button>
</div> </div>
</form> </form>

5
src/app/pages/license/file-category/edit-file-category/edit-file-category.component.ts

@ -57,6 +57,7 @@ export class EditFileCategoryComponent implements OnInit {
isLoadingSave: boolean = false isLoadingSave: boolean = false
uploadIndex: string uploadIndex: string
filechange(e) { filechange(e) {
this.isLoadingSave = true
let oilStationId = JSON.parse(sessionStorage.getItem('userdataOfgasstation')).organization.id let oilStationId = JSON.parse(sessionStorage.getItem('userdataOfgasstation')).organization.id
let file = e.target.files[0] || null //获取上传的文件 let file = e.target.files[0] || null //获取上传的文件
this.openFileSelect(file, `stationPhotos/${oilStationId}/`) this.openFileSelect(file, `stationPhotos/${oilStationId}/`)
@ -84,7 +85,7 @@ export class EditFileCategoryComponent implements OnInit {
let filePath: string = ObjectsSimpleService.baseUrl + dataObj.objectName; let filePath: string = ObjectsSimpleService.baseUrl + dataObj.objectName;
this.imageUrl = filePath this.imageUrl = filePath
this.data2.imageUrl = filePath this.data2.imageUrl = filePath
console.log('上传成功', filePath) this.isLoadingSave = false
resolve('success') resolve('success')
}); });
}) })
@ -100,7 +101,7 @@ export class EditFileCategoryComponent implements OnInit {
let filePath = dataObj.filePath let filePath = dataObj.filePath
this.imageUrl = filePath this.imageUrl = filePath
this.data2.imageUrl = filePath this.data2.imageUrl = filePath
console.log('上传成功', filePath) this.isLoadingSave = false
}); });
} }

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

@ -13,7 +13,7 @@
<div class="cutoffrule"></div> <div class="cutoffrule"></div>
<p>证件有效期: &nbsp;&nbsp;<span *ngIf="!data.isLongTerm">{{data.validityStartTime | date:"yyyy/MM/dd"}} - </span>{{data.validityEndTime | date:"yyyy/MM/dd"}}</p> <p>证件有效期: &nbsp;&nbsp;<span *ngIf="!data.isLongTerm">{{data.validityStartTime | date:"yyyy/MM/dd"}} - </span>{{data.validityEndTime | date:"yyyy/MM/dd"}}</p>
<div class="cutoffrule"></div> <div class="cutoffrule"></div>
<p>办理类型: &nbsp;&nbsp;{{getHandleTypes(data.handleTypes)}}</p> <p>办理类型: &nbsp;&nbsp;{{getHandleTypes(data.handleTypesDefault)}}</p>
<div class="cutoffrule"></div> <div class="cutoffrule"></div>
<p>有效期类型: &nbsp;&nbsp;{{data.validityDays || 0}}天</p> <p>有效期类型: &nbsp;&nbsp;{{data.validityDays || 0}}天</p>
<div class="cutoffrule"></div> <div class="cutoffrule"></div>

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

@ -38,7 +38,7 @@
<nz-form-item> <nz-form-item>
<nz-form-control> <nz-form-control>
<nz-select formControlName="type" nzMode="multiple" [(ngModel)]="data2.handleTypes"> <nz-select formControlName="type" nzMode="multiple" [(ngModel)]="data2.handleTypesDefault" nzDisabled>
<nz-option [nzValue]="item.value" [nzLabel]="item.name" *ngFor="let item of handleTypeList"></nz-option> <nz-option [nzValue]="item.value" [nzLabel]="item.name" *ngFor="let item of handleTypeList"></nz-option>
</nz-select> </nz-select>
</nz-form-control> </nz-form-control>
@ -47,24 +47,36 @@
<p>附件上传(图片格式、pdf格式、word格式)</p> <p>附件上传(图片格式、pdf格式、word格式)</p>
<div class="uploadDivbox"> <div class="uploadDivbox">
<div class="uploadDiv" style="margin-right: 12px;"> <div class="uploadDiv">
<img *ngIf="data2.imageUrl && getFileType(data2.imageUrl) == 'img'" style="width: 100%;height: 100%;cursor: pointer;" [src]="data2.imageUrl" (click)="viewImg(data2.imageUrl)"> <img *ngIf="data2.imageUrl && getFileType(data2.imageUrl) == 'img'" style="width: 100%;height: 100%;cursor: pointer;" [src]="data2.imageUrl" (click)="viewImg(data2.imageUrl)">
<img *ngIf="data2.imageUrl && getFileType(data2.imageUrl) == 'word'" src="../../../../assets/images/license/word.png" (click)="lookFile(data2)"> <img *ngIf="data2.imageUrl && getFileType(data2.imageUrl) == 'word'" src="../../../../assets/images/license/word.png" (click)="lookFile(data2.imageUrl)">
<img *ngIf="data2.imageUrl && getFileType(data2.imageUrl) == 'pdf'" src="../../../../assets/images/license/pdf.png" (click)="lookFile(data2)"> <img *ngIf="data2.imageUrl && getFileType(data2.imageUrl) == 'pdf'" src="../../../../assets/images/license/pdf.png" (click)="lookFile(data2.imageUrl)">
<input *ngIf="!data2.imageUrl" (change)="filechange($event)" class="fileinput" type="file" name="" id=""> <input *ngIf="!data2.imageUrl" (change)="filechange($event,true)" class="fileinput" type="file" name="" id="">
<button *ngIf="!data2.imageUrl" nz-button [nzLoading]=""><i nz-icon nzType="upload" <button *ngIf="!data2.imageUrl" nz-button [nzLoading]="isLoadingSave"><i nz-icon nzType="upload" nzTheme="outline"></i>上传附件</button>
nzTheme="outline"></i>上传附件</button>
</div> </div>
<div class="uploadDiv" *ngIf="data2.imageUrl"> <div class="uploadDiv" *ngIf="data2.imageUrl" style="margin: 0 10px;">
<input (change)="filechange($event)" class="fileinput" type="file" name="" id=""> <input (change)="filechange($event,true)" class="fileinput" type="file" name="" id="">
<button nz-button [nzLoading]=""><i nz-icon nzType="upload" nzTheme="outline"></i>重新上传</button> <button nz-button [nzLoading]="isLoadingSave"><i nz-icon nzType="upload" nzTheme="outline"></i>重新上传</button>
</div>
<div class="uploadDiv" *ngIf="data2.hasAttachmentDefault" style="margin: 0 10px;">
<img *ngIf="data2.attachment && getFileType(data2.attachment) == 'img'" style="width: 100%;height: 100%;cursor: pointer;" [src]="data2.attachment" (click)="viewImg(data2.attachment)">
<img *ngIf="data2.attachment && getFileType(data2.attachment) == 'word'" src="../../../../assets/images/license/word.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="">
<button *ngIf="!data2.attachment" nz-button [nzLoading]="isLoadingSave"><i nz-icon nzType="upload" nzTheme="outline"></i>上传副本</button>
</div>
<div class="uploadDiv" *ngIf="data2.attachment && data2.hasAttachmentDefault">
<input (change)="filechange($event,false)" class="fileinput" type="file" name="" id="">
<button nz-button [nzLoading]="isLoadingSave">重新上传副本</button>
</div> </div>
</div> </div>
<div class="btnbox"> <div class="btnbox">
<button nz-button type="submit" class="ok" (click)="submitReview()">提交审核</button> <button nz-button type="submit" class="ok" (click)="submitReview()" [nzLoading]="isLoadingSave">提交审核</button>
<button nz-button type="submit" class="ok" (click)="ok()">保存</button> <button nz-button type="submit" class="ok" (click)="ok()" [nzLoading]="isLoadingSave">保存</button>
<button nz-button type="button" class="cancel" (click)="destroyModal()">取消</button> <button nz-button type="button" class="cancel" (click)="destroyModal()">取消</button>
</div> </div>
</form> </form>

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

@ -119,25 +119,27 @@ export class EditUpdateCategoryComponent 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', '暂不支持查看!');
} }
} }
uploadType: boolean; //是否是上传副本
isLoadingSave: boolean = false isLoadingSave: boolean = false
uploadIndex: string uploadIndex: string
filechange(e) { filechange(e, type: boolean) {
this.uploadType = type
this.isLoadingSave = true
let oilStationId = JSON.parse(sessionStorage.getItem('userdataOfgasstation')).organization.id let oilStationId = JSON.parse(sessionStorage.getItem('userdataOfgasstation')).organization.id
let file = e.target.files[0] || null //获取上传的文件 let file = e.target.files[0] || null //获取上传的文件
this.openFileSelect(file, `stationPhotos/${oilStationId}/`) this.openFileSelect(file, `stationPhotos/${oilStationId}/`)
@ -163,9 +165,12 @@ export class EditUpdateCategoryComponent implements OnInit {
this.objectsSrv.postFile(this.postFilePath, file).subscribe(data => { this.objectsSrv.postFile(this.postFilePath, file).subscribe(data => {
let dataObj = data as any; let dataObj = data as any;
let filePath: string = ObjectsSimpleService.baseUrl + dataObj.objectName; let filePath: string = ObjectsSimpleService.baseUrl + dataObj.objectName;
this.imageUrl = filePath if (this.uploadType){
this.data2.imageUrl = filePath this.data2.imageUrl = filePath
console.log('上传成功', filePath) } else {
this.data2.attachment = filePath
}
this.isLoadingSave = false
resolve('success') resolve('success')
}); });
}) })
@ -179,9 +184,12 @@ export class EditUpdateCategoryComponent implements OnInit {
this.objectsSrv.postFile_MultipartUpload(this.postFilePath, file).then((value) => { this.objectsSrv.postFile_MultipartUpload(this.postFilePath, file).then((value) => {
let dataObj = value as any; let dataObj = value as any;
let filePath = dataObj.filePath let filePath = dataObj.filePath
this.imageUrl = filePath if (this.uploadType){
this.data2.imageUrl = filePath this.data2.imageUrl = filePath
console.log('上传成功', filePath) } else {
this.data2.attachment = filePath
}
this.isLoadingSave = false
}); });
} }

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

@ -35,7 +35,7 @@
</ng-template> </ng-template>
</td> </td>
<td>{{getHandleTypes(item.handleTypes)}}</td> <td>{{getHandleTypes(item.handleTypesDefault)}}</td>
<!-- <td><span *ngIf="item.isYearlyCheck">是</span><span *ngIf="!item.isYearlyCheck">否</span></td> <!-- <td><span *ngIf="item.isYearlyCheck">是</span><span *ngIf="!item.isYearlyCheck">否</span></td>
<td>{{item.committedTime | date:"yyyy/MM/dd"}}<span *ngIf="!item.committedTime">未提交审核</span></td> <td>{{item.committedTime | date:"yyyy/MM/dd"}}<span *ngIf="!item.committedTime">未提交审核</span></td>
<td> <td>

2
src/app/system-management/update-of-license/add-update-of-license/add-update-of-license.component.html

@ -44,7 +44,7 @@
<nz-form-item> <nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="是否年检">是否年检</nz-form-label> <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="是否年检">是否年检</nz-form-label>
<nz-form-control> <nz-form-control nzErrorTip="请选择是否年检">
<label nz-checkbox formControlName="isYearlyCheck"></label> <label nz-checkbox formControlName="isYearlyCheck"></label>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>

20
src/app/system-management/update-of-license/add-update-of-license/add-update-of-license.component.ts

@ -2,6 +2,7 @@ import { Component, OnInit, Input } from '@angular/core';
import { NzModalRef } from 'ng-zorro-antd/modal'; import { NzModalRef } from 'ng-zorro-antd/modal';
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { handleType,handleTypeList } from 'src/app/pages/license/inform/inform.component';
@Component({ @Component({
@ -13,30 +14,21 @@ export class AddUpdateOfLicenseComponent implements OnInit {
validateForm!: FormGroup; validateForm!: FormGroup;
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient) { } constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient) { }
handleTypeList = [
{ value: 0, name: "无" },
{ value: 1, name: "年度公示" },
{ value: 2, name: "年检" },
{ value: 3, name: "到期换证" },
{ value: 4, name: "年度执行报告" },
{ value: 5, name: "到期检测" },
{ value: 6, name: "年度复训" },
{ value: 7, name: "年度检测" },
{ value: 8, name: "到期备案" },
{ value: 9, name: "到期评价" },
]
ngOnInit(): void { ngOnInit(): void {
this.validateForm = this.fb.group({ this.validateForm = this.fb.group({
name: [null, [Validators.required]], name: [null, [Validators.required]],
handleRemindDays: [90, [Validators.required]], handleRemindDays: [90, [Validators.required]],
closingRemindDays: [30, [Validators.required]], closingRemindDays: [30, [Validators.required]],
handleType: [null, [Validators.required]], handleType: [[], [Validators.required]],
isEctype: [true, [Validators.required]], isEctype: [false, [Validators.required]],
isYearlyCheck: [true, [Validators.required]] isYearlyCheck: [true, [Validators.required]]
}); });
} }
destroyModal(): void { destroyModal(): void {
this.modal.destroy({ data: 'this the result data' }); this.modal.destroy({ data: 'this the result data' });
} }
handleTypeList: handleTypeList[] = new handleType().list; //办理类型list
} }

2
src/app/system-management/update-of-license/edit-update-of-license/edit-update-of-license.component.html

@ -42,7 +42,7 @@
</nz-form-item> </nz-form-item>
<nz-form-item> <nz-form-item>
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="是否年检">是否年检</nz-form-label> <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="是否年检">是否年检</nz-form-label>
<nz-form-control nzErrorTip="请输入临期提醒时间"> <nz-form-control nzErrorTip="请选择是否年检">
<label nz-checkbox formControlName="isYearlyCheck"></label> <label nz-checkbox formControlName="isYearlyCheck"></label>
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>

16
src/app/system-management/update-of-license/edit-update-of-license/edit-update-of-license.component.ts

@ -2,6 +2,7 @@ import { Component, OnInit, Input } from '@angular/core';
import { NzModalRef } from 'ng-zorro-antd/modal'; import { NzModalRef } from 'ng-zorro-antd/modal';
import { FormBuilder, FormGroup, Validators } from '@angular/forms'; import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { handleType,handleTypeList } from 'src/app/pages/license/inform/inform.component';
@Component({ @Component({
selector: 'app-edit-update-of-license', selector: 'app-edit-update-of-license',
@ -13,18 +14,7 @@ export class EditUpdateOfLicenseComponent implements OnInit {
@Input() data?: any; @Input() data?: any;
validateForm!: FormGroup; validateForm!: FormGroup;
constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient) { } constructor(private modal: NzModalRef, private fb: FormBuilder, private http: HttpClient) { }
handleTypeList = [
{ value: 0, name: "无" },
{ value: 1, name: "年度公示" },
{ value: 2, name: "年检" },
{ value: 3, name: "到期换证" },
{ value: 4, name: "年度执行报告" },
{ value: 5, name: "到期检测" },
{ value: 6, name: "年度复训" },
{ value: 7, name: "年度检测" },
{ value: 8, name: "到期备案" },
{ value: 9, name: "到期评价" },
]
ngOnInit(): void { ngOnInit(): void {
this.validateForm = this.fb.group({ this.validateForm = this.fb.group({
name: [this.data.licenseName, [Validators.required]], name: [this.data.licenseName, [Validators.required]],
@ -39,4 +29,6 @@ export class EditUpdateOfLicenseComponent implements OnInit {
this.modal.destroy({ data: 'this the result data' }); this.modal.destroy({ data: 'this the result data' });
} }
handleTypeList: handleTypeList[] = new handleType().list; //办理类型list
} }

1
src/app/system-management/update-of-license/update-of-license.component.ts

@ -51,7 +51,6 @@ export class UpdateOfLicenseComponent implements OnInit {
nzOnOk: async () => { nzOnOk: async () => {
if (instance.validateForm.valid) { if (instance.validateForm.valid) {
await new Promise(resolve => { await new Promise(resolve => {
console.log('表单信息', instance.validateForm)
let body = { let body = {
licenseName: instance.validateForm.value.name, licenseName: instance.validateForm.value.name,
handleRemindDays: instance.validateForm.value.handleRemindDays, handleRemindDays: instance.validateForm.value.handleRemindDays,

Loading…
Cancel
Save