|
@@ -63,17 +63,19 @@ export class FbsWorkshopDispatchListAddComponent implements OnInit {
|
|
|
/**
|
|
|
* 人员下拉款选择事件
|
|
|
*/
|
|
|
- personnelChange(personnelIdU8){
|
|
|
+ personnelChange(personnelIdU8,data){
|
|
|
//获取名称
|
|
|
this.properList.forEach(element => {
|
|
|
if(personnelIdU8===element.cpersoncode){
|
|
|
- this.fbsWorkshopDispatchList.name=element.cpersonname;
|
|
|
- this.fbsWorkshopDispatchList.personnelNameU8=element.cpersonname;
|
|
|
- this.fbsWorkshopDispatchList.productionLineId=element.cdepcode;//生产线id
|
|
|
- this.fbsWorkshopDispatchList.productionLineName=element.cdepname;//生产线名产
|
|
|
+ data.name=element.cpersonname;
|
|
|
+ data.personnelNameU8=element.cpersonname;
|
|
|
+ data.productionLineId=element.cdepcode;//生产线id
|
|
|
+ data.productionLineName=element.cdepname;//生产线名产
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 初始化生产订单号下拉数据集合
|
|
@@ -90,7 +92,7 @@ export class FbsWorkshopDispatchListAddComponent implements OnInit {
|
|
|
/**
|
|
|
* 生产订单号选中事件
|
|
|
*/
|
|
|
- productionOrderNumberChange(productionOrderNumberId){
|
|
|
+ productionOrderNumberChange(productionOrderNumberId,data){
|
|
|
// this.fbsWorkshopDispatchList.productionLineName="电器组装"
|
|
|
// this.fbsWorkshopDispatchList.productionOrderNumberName="SC001"
|
|
|
// this.fbsWorkshopDispatchList.product="产品001"
|
|
@@ -99,11 +101,11 @@ export class FbsWorkshopDispatchListAddComponent implements OnInit {
|
|
|
//获取生产编号
|
|
|
this.productionOrderNumberList.forEach(element => {
|
|
|
if(productionOrderNumberId===element.moid){
|
|
|
- this.fbsWorkshopDispatchList.productionOrderNumberName=element.mocode
|
|
|
+ data.productionOrderNumberName=element.mocode
|
|
|
}
|
|
|
});
|
|
|
//获取产品集合
|
|
|
- this.getProductList(productionOrderNumberId);
|
|
|
+ this.getProductList(productionOrderNumberId,data);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -112,29 +114,32 @@ export class FbsWorkshopDispatchListAddComponent implements OnInit {
|
|
|
* 根据生产id查询产品
|
|
|
*/
|
|
|
productList=[];//产品集合
|
|
|
- getProductList(moId){
|
|
|
+ getProductList(moId,data){
|
|
|
this.fbsWorkshopDispatchListService.getInventoryGetByOrderId(moId).then((response)=>{
|
|
|
- this.productList=response.result;
|
|
|
+ // this.productList=response.result;
|
|
|
+ data.productList=response.result;
|
|
|
})
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 产品选中事件 获取产品名称
|
|
|
*/
|
|
|
- productChange(event){
|
|
|
+ productChange(event,data){
|
|
|
if(event){
|
|
|
- this.productList.forEach(element => {
|
|
|
+ data.productList.forEach(element => {
|
|
|
if(element.cinvcode===event){
|
|
|
- this.fbsWorkshopDispatchList.product=element.cinvname;
|
|
|
+ data.product=element.cinvname;
|
|
|
+ data.projectName=element.CostItemName;
|
|
|
+ data.rowNumber=element.sortSeq;
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 保存
|
|
|
+ * 保存(暂未用)
|
|
|
*/
|
|
|
- save(){
|
|
|
+ saveHistort(){
|
|
|
//加载效果打开
|
|
|
this.saveLoading=true;
|
|
|
//时间格式化
|
|
@@ -153,6 +158,54 @@ export class FbsWorkshopDispatchListAddComponent implements OnInit {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+ save(){
|
|
|
+ //加载效果打开
|
|
|
+ this.saveLoading=true;
|
|
|
+ if(this.workshopDispatchListList){
|
|
|
+ this.workshopDispatchListList.forEach(element => {
|
|
|
+ element.date=this.datePipe.transform(this.fbsWorkshopDispatchList.date, 'yyyy-MM-dd HH:mm:ss');
|
|
|
+ element.plannedStartTime=this.datePipe.transform(this.fbsWorkshopDispatchList.plannedStartTime, 'yyyy-MM-dd HH:mm:ss');
|
|
|
+ element.plannedEndTime=this.datePipe.transform(this.fbsWorkshopDispatchList.plannedEndTime, 'yyyy-MM-dd HH:mm:ss');
|
|
|
+ });
|
|
|
+ }
|
|
|
+ let workshopDispatchList=new FbsWorkshopDispatchList();
|
|
|
+ workshopDispatchList.fbsWorkshopDispatchListList=this.workshopDispatchListList;
|
|
|
+ this.fbsWorkshopDispatchListService.saveBatch(workshopDispatchList).then((response)=>{
|
|
|
+ if(response.success){//保存成功
|
|
|
+ this.nzNotificationService.success("保存成功","");
|
|
|
+ this.saveLoading=false;//加载效果关闭
|
|
|
+ this.drawerRef.close(true);//关闭抽屉 启动主页面的回调
|
|
|
+ }else{//保存失败
|
|
|
+ this.nzNotificationService.error("保存失败",response.message);
|
|
|
+ this.saveLoading=false;//加载效果关闭
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增行
|
|
|
+ */
|
|
|
+ sort=1;
|
|
|
+ workshopDispatchListList=[]//派工集合
|
|
|
+ workshopDispatchAddRow(){
|
|
|
+ this.workshopDispatchListList = [
|
|
|
+ ...this.workshopDispatchListList,
|
|
|
+ {
|
|
|
+ date:new Date().toString(),
|
|
|
+ sort: this.sort,
|
|
|
+ },
|
|
|
+ ];
|
|
|
+ this.sort++;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除行
|
|
|
+ */
|
|
|
+ workshopDispatchDeleteRow(sort){
|
|
|
+ this.workshopDispatchListList = this.workshopDispatchListList.filter(d => d.sort !== sort);
|
|
|
+ }
|
|
|
+
|
|
|
close() {
|
|
|
//抽屉关闭
|
|
|
this.drawerRef.close();
|