|
@@ -2,23 +2,31 @@ import { Component, OnInit, ViewChild } from '@angular/core';
|
|
import { _HttpClient, ModalHelper } from '@delon/theme';
|
|
import { _HttpClient, ModalHelper } from '@delon/theme';
|
|
import { STColumn, STComponent } from '@delon/abc';
|
|
import { STColumn, STComponent } from '@delon/abc';
|
|
import { SFSchema } from '@delon/form';
|
|
import { SFSchema } from '@delon/form';
|
|
-import { NzDrawerService } from 'ng-zorro-antd';
|
|
|
|
|
|
+import { NzDrawerService, NzNotificationService } from 'ng-zorro-antd';
|
|
import { FbsWorkshopDispatchListAddComponent } from '../add/add.component';
|
|
import { FbsWorkshopDispatchListAddComponent } from '../add/add.component';
|
|
import { FbsWorkshopDispatchList } from 'app/entity/fbs/fbs-workshop-dispatch-list';
|
|
import { FbsWorkshopDispatchList } from 'app/entity/fbs/fbs-workshop-dispatch-list';
|
|
import { FbsWorkshopDispatchListUpdateComponent } from '../update/update.component';
|
|
import { FbsWorkshopDispatchListUpdateComponent } from '../update/update.component';
|
|
import { FbsWorkshopDispatchListViewComponent } from '../view/view.component';
|
|
import { FbsWorkshopDispatchListViewComponent } from '../view/view.component';
|
|
|
|
+import { FbsWorkshopDispatchListService } from 'app/services/fbs/fbs-workshop-dispatch-list.service';
|
|
|
|
|
|
@Component({
|
|
@Component({
|
|
selector: 'app-fbs-workshop-dispatch-list-list',
|
|
selector: 'app-fbs-workshop-dispatch-list-list',
|
|
templateUrl: './list.component.html',
|
|
templateUrl: './list.component.html',
|
|
})
|
|
})
|
|
export class FbsWorkshopDispatchListListComponent implements OnInit {
|
|
export class FbsWorkshopDispatchListListComponent implements OnInit {
|
|
- constructor(private nzDrawerService: NzDrawerService) {}
|
|
|
|
|
|
+ constructor(
|
|
|
|
+ private nzDrawerService: NzDrawerService,
|
|
|
|
+ private fbsWorkshopDispatchListService: FbsWorkshopDispatchListService,
|
|
|
|
+ private nzNotificationService: NzNotificationService
|
|
|
|
+ ) {}
|
|
|
|
|
|
- ngOnInit() {}
|
|
|
|
|
|
+ ngOnInit() {
|
|
|
|
+ this.getList();
|
|
|
|
+ }
|
|
|
|
|
|
- dataList = [{}]; //表格数据
|
|
|
|
|
|
+ dataList = []; //表格数据
|
|
isLoading = false; //表格加载
|
|
isLoading = false; //表格加载
|
|
|
|
+ //分页参数
|
|
page = {
|
|
page = {
|
|
total: 0,
|
|
total: 0,
|
|
current: 0,
|
|
current: 0,
|
|
@@ -26,10 +34,34 @@ export class FbsWorkshopDispatchListListComponent implements OnInit {
|
|
};
|
|
};
|
|
fbsWorkshopDispatchList: FbsWorkshopDispatchList = {}; //派工单对象
|
|
fbsWorkshopDispatchList: FbsWorkshopDispatchList = {}; //派工单对象
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 查询按钮
|
|
|
|
+ */
|
|
|
|
+ query(){
|
|
|
|
+ this.fbsWorkshopDispatchList.pageNo=1;
|
|
|
|
+ //主数据刷新
|
|
|
|
+ this.getList();
|
|
|
|
+ }
|
|
|
|
+
|
|
// 按页码查询
|
|
// 按页码查询
|
|
pageIndexChange(event) {
|
|
pageIndexChange(event) {
|
|
this.fbsWorkshopDispatchList.pageNo = event;
|
|
this.fbsWorkshopDispatchList.pageNo = event;
|
|
//主数据刷新
|
|
//主数据刷新
|
|
|
|
+ this.getList();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 主数据查询
|
|
|
|
+ */
|
|
|
|
+ getList(){
|
|
|
|
+ this.isLoading=true
|
|
|
|
+ this.fbsWorkshopDispatchListService.list(this.fbsWorkshopDispatchList).then((response)=>{
|
|
|
|
+ if(response.success){//查询成功
|
|
|
|
+ this.dataList=response.result.records;//表格数据
|
|
|
|
+ this.page=response.result;//分页数据
|
|
|
|
+ this.isLoading=false;
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -49,40 +81,62 @@ export class FbsWorkshopDispatchListListComponent implements OnInit {
|
|
drawerRef.afterClose.subscribe(isRefresh => {
|
|
drawerRef.afterClose.subscribe(isRefresh => {
|
|
if (isRefresh) {
|
|
if (isRefresh) {
|
|
//刷新list列表
|
|
//刷新list列表
|
|
- // this.getPreList();
|
|
|
|
|
|
+ this.getList();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
- view() {
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 详情按钮
|
|
|
|
+ */
|
|
|
|
+ view(item) {
|
|
//打开详情抽屉
|
|
//打开详情抽屉
|
|
const drawerRef = this.nzDrawerService.create<FbsWorkshopDispatchListViewComponent>({
|
|
const drawerRef = this.nzDrawerService.create<FbsWorkshopDispatchListViewComponent>({
|
|
nzTitle: '详情车间派工单',
|
|
nzTitle: '详情车间派工单',
|
|
nzContent: FbsWorkshopDispatchListViewComponent,
|
|
nzContent: FbsWorkshopDispatchListViewComponent,
|
|
nzWidth: window.innerWidth,
|
|
nzWidth: window.innerWidth,
|
|
nzBodyStyle: { height: 'calc(100% - 55px)', overflow: 'auto', 'padding-bottom': '53px' },
|
|
nzBodyStyle: { height: 'calc(100% - 55px)', overflow: 'auto', 'padding-bottom': '53px' },
|
|
- nzContentParams: {},
|
|
|
|
|
|
+ nzContentParams: {
|
|
|
|
+ id:item.id
|
|
|
|
+ },
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
- update() {
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 修改按钮
|
|
|
|
+ */
|
|
|
|
+ update(item) {
|
|
//打开修改抽屉
|
|
//打开修改抽屉
|
|
const drawerRef = this.nzDrawerService.create<FbsWorkshopDispatchListUpdateComponent>({
|
|
const drawerRef = this.nzDrawerService.create<FbsWorkshopDispatchListUpdateComponent>({
|
|
nzTitle: '修改车间派工单',
|
|
nzTitle: '修改车间派工单',
|
|
nzContent: FbsWorkshopDispatchListUpdateComponent,
|
|
nzContent: FbsWorkshopDispatchListUpdateComponent,
|
|
nzWidth: window.innerWidth,
|
|
nzWidth: window.innerWidth,
|
|
nzBodyStyle: { height: 'calc(100% - 55px)', overflow: 'auto', 'padding-bottom': '53px' },
|
|
nzBodyStyle: { height: 'calc(100% - 55px)', overflow: 'auto', 'padding-bottom': '53px' },
|
|
- nzContentParams: {},
|
|
|
|
|
|
+ nzContentParams: {
|
|
|
|
+ id:item.id
|
|
|
|
+ },
|
|
});
|
|
});
|
|
|
|
|
|
//关闭抽屉的回调
|
|
//关闭抽屉的回调
|
|
drawerRef.afterClose.subscribe(isRefresh => {
|
|
drawerRef.afterClose.subscribe(isRefresh => {
|
|
if (isRefresh) {
|
|
if (isRefresh) {
|
|
//刷新list列表
|
|
//刷新list列表
|
|
- // this.getPreList();
|
|
|
|
|
|
+ this.getList();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
- delete() {}
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 删除按钮
|
|
|
|
+ */
|
|
|
|
+ delete(item) {
|
|
|
|
+ this.fbsWorkshopDispatchListService.deleteAndChild(item.id).then((response)=>{
|
|
|
|
+ if(response.success){
|
|
|
|
+ this.nzNotificationService.success("删除成功","");
|
|
|
|
+ this.getList();//刷新
|
|
|
|
+ }else{
|
|
|
|
+ this.nzNotificationService.warning("删除失败","");
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
}
|
|
}
|