From 71022db02b72d005d7951dabba5c144d65dc74b9 Mon Sep 17 00:00:00 2001
From: SHAOJIAHAO <55341701@qq.com>
Date: Fri, 26 May 2023 10:33:53 +0800
Subject: [PATCH] =?UTF-8?q?[=E6=96=B0=E5=A2=9E]superadmin=E8=B4=A6?=
=?UTF-8?q?=E5=8F=B7=E5=8D=B8=E6=B2=B9=E5=A2=9E=E5=8A=A0=E5=88=A0=E9=99=A4?=
=?UTF-8?q?=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../oil-unloading-process-list.component.html | 2 +
.../oil-unloading-process-list.component.ts | 38 ++++++++++++++++++-
2 files changed, 39 insertions(+), 1 deletion(-)
diff --git a/src/app/pages/records/oil-unloading-process-list/oil-unloading-process-list.component.html b/src/app/pages/records/oil-unloading-process-list/oil-unloading-process-list.component.html
index b27841f..9bfaea5 100644
--- a/src/app/pages/records/oil-unloading-process-list/oil-unloading-process-list.component.html
+++ b/src/app/pages/records/oil-unloading-process-list/oil-unloading-process-list.component.html
@@ -149,6 +149,8 @@
查看
+ 删除
|
diff --git a/src/app/pages/records/oil-unloading-process-list/oil-unloading-process-list.component.ts b/src/app/pages/records/oil-unloading-process-list/oil-unloading-process-list.component.ts
index c6bbdb8..53c0dc6 100644
--- a/src/app/pages/records/oil-unloading-process-list/oil-unloading-process-list.component.ts
+++ b/src/app/pages/records/oil-unloading-process-list/oil-unloading-process-list.component.ts
@@ -100,6 +100,7 @@ export class OilUnloadingProcessListComponent implements OnInit {
button = false;
tableScrollHeight;
resizeListener;
+ loginUserInfo;
ngOnInit(): void {
this.tableScrollHeight = "100px";
// 页面监听
@@ -126,7 +127,7 @@ export class OilUnloadingProcessListComponent implements OnInit {
loginUserInfo = JSON.parse(sessionStorage.getItem("userdata"));
this.returnLastMenus(false);
}
-
+ this.loginUserInfo = loginUserInfo;
if (
loginUserInfo.roles.find((item) => {
return item.name == "ViolationPositiveCensorer";
@@ -929,6 +930,41 @@ export class OilUnloadingProcessListComponent implements OnInit {
const instance = modal.getContentComponent();
}
+ //删除某个卸油
+ delete(item) {
+ console.log(item);
+ this.modal.confirm({
+ nzTitle: `确认要删除${item.gasStation.stationName}的此条卸油记录吗`,
+ nzOkText: "确定",
+ nzOkType: "primary",
+ nzOkDanger: true,
+ nzOnOk: () => {
+ this.http
+ .delete("/api/services/app/OilUnloadingProcess/Delete", {
+ params: {
+ Id: item.id,
+ },
+ })
+ .subscribe({
+ next: (data) => {
+ this.message.create("success", "删除成功");
+ for (let index = 0; index < this.list.length; index++) {
+ const element = this.list[index];
+ if (element.id == item.id) {
+ this.list.splice(index, 1);
+ this.totalCount = String(Number(this.totalCount) - 1);
+ this.SkipCount = String(Number(this.SkipCount) - 1);
+ this.list = [...this.list];
+ }
+ }
+ },
+ });
+ },
+ nzCancelText: "取消",
+ nzOnCancel: () => console.log("Cancel"),
+ });
+ }
+
gorecordList() {
if (this.router.url.indexOf("petrolStation") != -1) {
this.router.navigate(["/records/petrolStation"]);