Browse Source

[新增]admin用户在数字油站页面可以编辑基本信息

beijing
邵佳豪 2 years ago
parent
commit
c461bf2961
  1. 2
      src/app/pages/audit/gas-base-info/gas-base-info.component.ts
  2. 6
      src/app/pages/home/home.component.ts
  3. 6
      src/app/pages/oil-station-info/oil-station-info.component.html
  4. 11
      src/app/pages/oil-station-info/oil-station-info.component.ts
  5. 1
      src/app/pages/plan-admin/oil-station-list/oil-station-list.component.html
  6. 11
      src/app/pages/plan-admin/oil-station-list/oil-station-list.component.ts
  7. 26
      src/app/ui/tabbar/tabbar.component.html
  8. 27
      src/app/ui/tabbar/tabbar.component.scss
  9. 86
      src/app/ui/tabbar/tabbar.component.ts
  10. 6
      src/app/ui/ui.module.ts

2
src/app/pages/audit/gas-base-info/gas-base-info.component.ts

@ -16,6 +16,7 @@ export class GasBaseInfoComponent implements OnInit {
isDetails: boolean = false; //是否是详情
ngOnInit(): void {
if (this.data.id === undefined) { //详情
this.isDetails = true
}
@ -36,6 +37,7 @@ export class GasBaseInfoComponent implements OnInit {
data.result.govUnitDetail ? data.result.govUnitDetail = JSON.parse(data.result.govUnitDetail) : null;
this.baseInfo = data.result
this.baseInfo.otherData ? this.otherData = JSON.parse(this.baseInfo.otherData) : null
console.log('baseInfo', this.baseInfo)
console.log('otherData', this.otherData)
})
}

6
src/app/pages/home/home.component.ts

@ -488,7 +488,11 @@ export class HomeComponent implements OnInit {
}
navChange(router) {
this.router.navigate([router])
if (router == '/oliStationInfo') {
this.router.navigate([router], { queryParams: { 'id': JSON.parse(sessionStorage.getItem('userdata')).organization.id } })
} else {
this.router.navigate([router])
}
}
navChange2() {
for (let index = 0; index < this.menu3.length; index++) {

6
src/app/pages/oil-station-info/oil-station-info.component.html

@ -11,7 +11,7 @@
<tr>
<td class="head">站名</td>
<td class="text organizations">
{{userdata.organization.displayName}}
{{httpBody.stationName}}
</td>
<td class="head">开业时间<span style="color: red;">*</span></td>
<td class="text">
@ -700,9 +700,9 @@
style="color: #fff;margin-right: 30px;">当前审核状态:{{httpBody.auditLog.auditStatusDesc}}</span>
<span *ngIf="httpBody.auditLog" style="color: #fff;">审核意见:{{httpBody.auditLog.rejectReason}}</span>
<button [nzLoading]="isSubmitAuditLoading" nz-button type="button"
*ngIf="httpBody.auditStatus != 1 && httpBody.auditStatus != 2" (click)="submitAudit()">提交审核</button>
*ngIf="httpBody.auditStatus != 1 && httpBody.auditStatus != 2 && userdata.userName != 'admin'" (click)="submitAudit()">提交审核</button>
<button [nzLoading]="isRevocationAuditLoading" nz-button type="button"
*ngIf="httpBody.auditStatus == 1 || httpBody.auditStatus == 2" (click)="revocationAudit()">撤销审核</button>
*ngIf="httpBody.auditStatus == 1 || httpBody.auditStatus == 2 && userdata.userName != 'admin'" (click)="revocationAudit()">撤销审核</button>
<button [nzLoading]="isLoadingSave" nz-button type="button" (click)="submitForm()"
*ngIf="httpBody.auditStatus != 1">保存</button>
<button (click)="exportExcel()" nz-button type="button"><img style="vertical-align: top;margin-right: 6px;"

11
src/app/pages/oil-station-info/oil-station-info.component.ts

@ -13,7 +13,7 @@ import { Router, ActivatedRoute } from '@angular/router'
})
export class OilStationInfoComponent implements OnInit {
validateForm!: FormGroup;
constructor(private router: Router, private fb: FormBuilder, private objectsSrv: ObjectsSimpleService, private http: HttpClient, private message: NzMessageService) { }
constructor(private router: Router, private fb: FormBuilder, private objectsSrv: ObjectsSimpleService, private http: HttpClient, private message: NzMessageService, public route: ActivatedRoute) { }
userdata: any
@ -22,7 +22,7 @@ export class OilStationInfoComponent implements OnInit {
this.userdata = JSON.parse(sessionStorage.getItem('userdata'))
this.validateForm = this.fb.group({
oilStation: this.fb.group({
organization: [this.userdata.organization.displayName],
organization: [],
startBusinessTime: [null, [Validators.required]],
oilStationType: [null],
laneNumber: [null],
@ -67,7 +67,7 @@ export class OilStationInfoComponent implements OnInit {
getInfo() {
this.http.get('/api/services/app/GasStation/Get', {
params: {
organizationUnitId: this.userdata.organization.id
organizationUnitId: this.route.snapshot.queryParams.id
}
}).subscribe((data: any) => {
@ -215,7 +215,7 @@ export class OilStationInfoComponent implements OnInit {
this.isUploadLoading = true
let file = e.target.files[0] || null //获取上传的文件
this.uploadType = type
this.openFileSelect(file, `stationPhotos/${this.userdata.organization.id}/`, item)
this.openFileSelect(file, `stationPhotos/${this.route.snapshot.queryParams.id}/`, item)
}
//设置文件路径并上传
postFilePath
@ -277,7 +277,8 @@ export class OilStationInfoComponent implements OnInit {
}, 0);
}
goback() {
this.router.navigate(['/todaywarning/petrolStation'])
// this.router.navigate(['/todaywarning/petrolStation'])
history.go(-1);
}
isLoadingSave: boolean = false

1
src/app/pages/plan-admin/oil-station-list/oil-station-list.component.html

@ -68,6 +68,7 @@
<span>{{item.tankVolume ? 'm³' : null}}</span>
</td>
<td>
<span *ngIf="userName == 'admin'" class="look" (click)="edit(item)" style="cursor:pointer;color: #36A2FF;margin-right: 6px;">编辑</span>
<span class="look" (click)="look(item)" style="cursor:pointer;color: #36A2FF">查看</span>
</td>
</tr>

11
src/app/pages/plan-admin/oil-station-list/oil-station-list.component.ts

@ -22,7 +22,12 @@ export class OilStationListComponent implements OnInit {
tableScrollHeight
resizeListener
userName
ngOnInit(): void {
this.userName = JSON.parse(sessionStorage.getItem('userdata')).userName
this.tableScrollHeight = '100px'
// 页面监听
this.resizeListener = fromEvent(window, 'resize').pipe(debounceTime(100)).subscribe((event) => {
@ -114,6 +119,12 @@ export class OilStationListComponent implements OnInit {
}
edit(item) {
this.router.navigate(['/oliStationInfo'], { queryParams: { 'id': item.organizationUnitId } })
}
tableSpin: boolean
totalCount: any //总数
//获取点击组织机构的所有加油站

26
src/app/ui/tabbar/tabbar.component.html

@ -1,26 +0,0 @@
<div class="box">
<div class="boxleft">
<img style="width: 200px;" src="../../../assets/images/logo2.png" alt="">
</div>
<!-- 登录信息按钮 -->
<div class="boxright">
<span class="time">
{{time}}
</span>
<span style="margin: 0 18px;">|</span>
<span style="margin-right: 8px;"> {{surname}} </span>
<a nz-dropdown [nzDropdownMenu]="menu" [nzTrigger]="'click'" [nzBackdrop]='false'>
<img src="../../../assets/images/head.png" alt="">
</a>
<nz-dropdown-menu #menu="nzDropdownMenu">
<ul nz-menu nzSelectable>
<li *ngIf="isGasStation == 'true'" nz-menu-item (click)="navChange('/oliStationInfo')">基本信息</li>
<li *ngIf="isGasStation == 'true'" nz-menu-item (click)="navChange('/equipmentInfo')">器材信息</li>
<li *ngIf="userName == 'admin'" nz-menu-item (click)="navChange('/system/organization')">系统管理</li>
<li nz-menu-item (click)="signOut()">退出系统</li>
</ul>
</nz-dropdown-menu>
</div>
</div>

27
src/app/ui/tabbar/tabbar.component.scss

@ -1,27 +0,0 @@
.box {
width: 100%;
height: 56px;
background: linear-gradient(#01142f, #0d2b4f);
display: flex;
justify-content: space-between;
align-items: center;
color: #fff;
box-sizing: border-box;
padding: 0 20px;
color: #8aacce;
}
.boxright {
display: flex;
align-items: center;
span {
font-size: 16px;
color: #FFFFFF;
opacity: 0.6;
}
img {
width: 36px;
height: 36px;
}
}

86
src/app/ui/tabbar/tabbar.component.ts

@ -1,86 +0,0 @@
import { Component, OnInit, Output, EventEmitter } from '@angular/core';
import { HttpClient } from '@angular/common/http'
import { Router, ActivatedRoute } from '@angular/router'
import { CacheTokenService } from '../../service/cache-token.service' //引入服务
import { NzMessageService } from 'ng-zorro-antd/message';
@Component({
selector: 'app-tabbar',
templateUrl: './tabbar.component.html',
styleUrls: ['./tabbar.component.scss']
})
export class TabbarComponent implements OnInit {
constructor(private http: HttpClient, private router: Router, private route: ActivatedRoute, public token: CacheTokenService,
private message: NzMessageService) { }
surname: string
userName: string
isGasStation: string
ngOnInit() {
setInterval(() => {
this.getTime()
}, 1000);
this.isGasStation = JSON.parse(sessionStorage.getItem('isGasStation'))
if (this.isGasStation == 'true') {
this.surname = JSON.parse(sessionStorage.getItem('userdataOfgasstation')).name
this.userName = JSON.parse(sessionStorage.getItem('userdataOfgasstation')).userName
} else {
this.surname = JSON.parse(sessionStorage.getItem('userdata')).name
this.userName = JSON.parse(sessionStorage.getItem('userdata')).userName
}
}
//获得时间
time: string
getTime() {
let myDate = new Date();
let y = myDate.getFullYear();
let M = myDate.getMonth() + 1; //获取当前月份(0-11,0代表1月)
let d = myDate.getDate(); //获取当前日(1-31)
let h = myDate.getHours(); //获取当前小时数(0-23)
let m = myDate.getMinutes(); //获取当前分钟数(0-59)
let s = myDate.getSeconds(); //获取当前秒数(0-59)
//检查是否小于10
M = check(M);
d = check(d);
h = check(h);
m = check(m);
s = check(s);
let timestr = y + "-" + M + "-" + d + " " + h + ":" + m + ":" + s;
this.time = timestr;
//时间数字小于10,则在之前加个“0”补位。
function check(i) {
let num = (i < 10) ? ("0" + i) : i;
return num;
}
}
//退出系统
signOut() {
this.message.create('success', `退出成功`);
this.token.delete()
sessionStorage.clear()
// window.localStorage.clear()
localStorage.removeItem("isautologin")
this.router.navigate(['/login'])
}
navChange(router) {
this.router.navigate([router])
}
//修改密码
changpsw() {
// let dialogRef = this.dialog.open(ChangepasswordComponent, { width: '348.000051px' });
// dialogRef.afterClosed().subscribe();
}
}

6
src/app/ui/ui.module.ts

@ -15,13 +15,11 @@ import { IsnoPipe } from '../pipes/boolean.pipe';
import { ConfirmpswDirective } from './changepassword/equal-validator.directive';
import { TimePipe } from '../pipes/time.pipe';
import { PaginatorModule } from './paginator/paginator.module';
import { TabbarComponent } from './tabbar/tabbar.component';
import { NzDropDownModule } from 'ng-zorro-antd/dropdown';
import { TitleComponent } from './title/title.component';
import { NzMessageModule } from 'ng-zorro-antd/message';
@NgModule({
declarations: [TabbarComponent,UserdataComponent, ChangepasswordComponent, IsnoPipe, ConfirmpswDirective, TimePipe, EditUser, TitleComponent],
declarations: [UserdataComponent, ChangepasswordComponent, IsnoPipe, ConfirmpswDirective, TimePipe, EditUser, TitleComponent],
imports: [
CommonModule,
@ -40,7 +38,7 @@ import { NzMessageModule } from 'ng-zorro-antd/message';
NzMessageModule
],
exports:[TabbarComponent,TitleComponent]
exports:[TitleComponent]
})
export class UiModule { }

Loading…
Cancel
Save