|
@@ -7,6 +7,7 @@ import { DatePipe } from '@angular/common';
|
|
|
import { FbsAbnormalWorkingHoursDescribe } from 'app/entity/fbs/fbs-abnormal-working-hours-describe';
|
|
|
import { FbsAbnormalWorkingHoursType } from 'app/entity/fbs/fbs-abnormal-working-hours-type';
|
|
|
import { FbsWorkshopDispatchListService } from 'app/services/fbs/fbs-workshop-dispatch-list.service';
|
|
|
+import { resolve } from 'url';
|
|
|
|
|
|
@Component({
|
|
|
selector: 'app-fbs-abnormal-working-hours-update',
|
|
@@ -33,18 +34,24 @@ export class FbsAbnormalWorkingHoursUpdateComponent implements OnInit {
|
|
|
private fbsAbnormalWorkingHoursService: FbsAbnormalWorkingHoursService,
|
|
|
private nzNotificationService: NzNotificationService,
|
|
|
private datePipe: DatePipe,
|
|
|
- private fbsWorkshopDispatchListService:FbsWorkshopDispatchListService
|
|
|
+ private fbsWorkshopDispatchListService: FbsWorkshopDispatchListService,
|
|
|
) {}
|
|
|
|
|
|
ngOnInit(): void {
|
|
|
this.getProperList();
|
|
|
- this.getById().then(()=>{
|
|
|
- return this.getDescribeListById()
|
|
|
- }).then(()=>{
|
|
|
- return this.getTypeById();
|
|
|
- }).then(()=>{
|
|
|
- this.saveLoading=false;
|
|
|
- })
|
|
|
+ this.getById()
|
|
|
+ .then(() => {
|
|
|
+ return this.getDescribeListById();
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ return this.getTypeById();
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ return this.getProductList();
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.saveLoading = false;
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
saveLoading = false;
|
|
@@ -53,23 +60,23 @@ export class FbsAbnormalWorkingHoursUpdateComponent implements OnInit {
|
|
|
|
|
|
* 初始化人员下拉数据集合
|
|
|
*/
|
|
|
- getProperList(){
|
|
|
- this.fbsWorkshopDispatchListService.getPerAndDerp().then((response)=>{
|
|
|
- this.properList=response.result
|
|
|
- })
|
|
|
+ getProperList() {
|
|
|
+ this.fbsWorkshopDispatchListService.getPerAndDerp().then(response => {
|
|
|
+ this.properList = response.result;
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
|
|
|
* 人员下拉款选择事件
|
|
|
*/
|
|
|
- personnelChange(personnelIdU8){
|
|
|
+ personnelChange(personnelIdU8) {
|
|
|
|
|
|
this.properList.forEach(element => {
|
|
|
- if(personnelIdU8===element.cpersoncode){
|
|
|
- this.fbsAbnormalWorkingHours.name=element.cpersonname;
|
|
|
- this.fbsAbnormalWorkingHours.personnelNameU8=element.cpersonname;
|
|
|
- this.fbsAbnormalWorkingHours.productionLineId=element.cdepcode;
|
|
|
- this.fbsAbnormalWorkingHours.productionLineName=element.cdepname;
|
|
|
+ if (personnelIdU8 === element.cpersoncode) {
|
|
|
+ this.fbsAbnormalWorkingHours.name = element.cpersonname;
|
|
|
+ this.fbsAbnormalWorkingHours.personnelNameU8 = element.cpersonname;
|
|
|
+ this.fbsAbnormalWorkingHours.productionLineId = element.cdepcode;
|
|
|
+ this.fbsAbnormalWorkingHours.productionLineName = element.cdepname;
|
|
|
}
|
|
|
});
|
|
|
}
|
|
@@ -80,14 +87,15 @@ export class FbsAbnormalWorkingHoursUpdateComponent implements OnInit {
|
|
|
id = '';
|
|
|
getById() {
|
|
|
return new Promise(resolve => {
|
|
|
- this.saveLoading=true;
|
|
|
+ this.saveLoading = true;
|
|
|
this.fbsAbnormalWorkingHoursService.getById(this.id).then(response => {
|
|
|
- if(response.success){
|
|
|
- this.fbsAbnormalWorkingHours=response.result;
|
|
|
+ if (response.success) {
|
|
|
+
|
|
|
+ this.fbsAbnormalWorkingHours = response.result;
|
|
|
resolve();
|
|
|
- }else{
|
|
|
- this.nzNotificationService.error("查询失败",response.message)
|
|
|
- this.saveLoading=false;
|
|
|
+ } else {
|
|
|
+ this.nzNotificationService.error('查询失败', response.message);
|
|
|
+ this.saveLoading = false;
|
|
|
}
|
|
|
});
|
|
|
});
|
|
@@ -96,37 +104,63 @@ export class FbsAbnormalWorkingHoursUpdateComponent implements OnInit {
|
|
|
|
|
|
* 查询异常工时描述
|
|
|
*/
|
|
|
- getDescribeListById(){
|
|
|
- return new Promise((resolve)=>{
|
|
|
+ getDescribeListById() {
|
|
|
+ return new Promise(resolve => {
|
|
|
|
|
|
- let fbsAbnormalWorkingHoursDescribe=new FbsAbnormalWorkingHoursDescribe();
|
|
|
- fbsAbnormalWorkingHoursDescribe.pageSize=1000;
|
|
|
- fbsAbnormalWorkingHoursDescribe.abnormalWorkingHoursId=this.fbsAbnormalWorkingHours.id;
|
|
|
+ let fbsAbnormalWorkingHoursDescribe = new FbsAbnormalWorkingHoursDescribe();
|
|
|
+ fbsAbnormalWorkingHoursDescribe.pageSize = 1000;
|
|
|
+ fbsAbnormalWorkingHoursDescribe.abnormalWorkingHoursId = this.fbsAbnormalWorkingHours.id;
|
|
|
|
|
|
- this.fbsAbnormalWorkingHoursService.getDescribeList(fbsAbnormalWorkingHoursDescribe).then((response)=>{
|
|
|
- this.describeList=response.result.records;
|
|
|
- this.describeSort=this.describeList.length+1;
|
|
|
+ this.fbsAbnormalWorkingHoursService.getDescribeList(fbsAbnormalWorkingHoursDescribe).then(response => {
|
|
|
+ this.describeList = response.result.records;
|
|
|
+ this.describeSort = this.describeList.length + 1;
|
|
|
resolve();
|
|
|
- })
|
|
|
- })
|
|
|
+ });
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
|
|
|
* 查询异常工时类别
|
|
|
*/
|
|
|
- getTypeById(){
|
|
|
- return new Promise((resolve)=>{
|
|
|
+ getTypeById() {
|
|
|
+ return new Promise(resolve => {
|
|
|
|
|
|
- let fbsAbnormalWorkingHoursType=new FbsAbnormalWorkingHoursType();
|
|
|
- fbsAbnormalWorkingHoursType.pageSize=1000;
|
|
|
- fbsAbnormalWorkingHoursType.abnormalWorkingHoursId=this.fbsAbnormalWorkingHours.id;
|
|
|
+ let fbsAbnormalWorkingHoursType = new FbsAbnormalWorkingHoursType();
|
|
|
+ fbsAbnormalWorkingHoursType.pageSize = 1000;
|
|
|
+ fbsAbnormalWorkingHoursType.abnormalWorkingHoursId = this.fbsAbnormalWorkingHours.id;
|
|
|
|
|
|
- this.fbsAbnormalWorkingHoursService.getTypeList(fbsAbnormalWorkingHoursType).then((response)=>{
|
|
|
- this.typeList=response.result.records;
|
|
|
- this.typeSort=this.typeList.length+1;
|
|
|
+ this.fbsAbnormalWorkingHoursService.getTypeList(fbsAbnormalWorkingHoursType).then(response => {
|
|
|
+ this.typeList = response.result.records;
|
|
|
+ this.typeSort = this.typeList.length + 1;
|
|
|
resolve();
|
|
|
- })
|
|
|
- })
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ productList = [];
|
|
|
+ getProductList() {
|
|
|
+ return new Promise(resolve => {
|
|
|
+
|
|
|
+ let date = this.datePipe.transform(this.fbsAbnormalWorkingHours.date, 'yyyy-MM-dd HH:mm:ss');
|
|
|
+ this.fbsAbnormalWorkingHoursService.getDispatchListByDate(date).then(response => {
|
|
|
+ this.productList = response.result;
|
|
|
+ resolve();
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 产品选择事件(获取产品名称、派工id)
|
|
|
+ */
|
|
|
+ productChange(event) {
|
|
|
+ if (event) {
|
|
|
+ this.productList.forEach(element => {
|
|
|
+ if (event === element.productId) {
|
|
|
+ this.fbsAbnormalWorkingHours.workshopDispatchListId = element.id;
|
|
|
+ this.fbsAbnormalWorkingHours.product = element.product;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
describeList = [];
|
|
@@ -179,7 +213,7 @@ export class FbsAbnormalWorkingHoursUpdateComponent implements OnInit {
|
|
|
* 保存按钮
|
|
|
*/
|
|
|
save() {
|
|
|
- this.saveLoading=true;
|
|
|
+ this.saveLoading = true;
|
|
|
|
|
|
this.fbsAbnormalWorkingHours.date = this.datePipe.transform(
|
|
|
this.fbsAbnormalWorkingHours.date,
|
|
@@ -195,7 +229,7 @@ export class FbsAbnormalWorkingHoursUpdateComponent implements OnInit {
|
|
|
this.drawerRef.close(true);
|
|
|
} else {
|
|
|
|
|
|
- this.nzNotificationService.error('保存失败',response.message);
|
|
|
+ this.nzNotificationService.error('保存失败', response.message);
|
|
|
this.saveLoading = false;
|
|
|
}
|
|
|
});
|