chenc 4 years ago
parent
commit
2a12931cca
21 changed files with 666 additions and 12 deletions
  1. 15 0
      src/app/entity/fbs/fbs-technological-process-item.ts
  2. 15 0
      src/app/entity/fbs/fbs-technological-process.ts
  3. 39 0
      src/app/routes/fbs-technological-process/add/add.component.html
  4. 24 0
      src/app/routes/fbs-technological-process/add/add.component.spec.ts
  5. 67 0
      src/app/routes/fbs-technological-process/add/add.component.ts
  6. 13 0
      src/app/routes/fbs-technological-process/fbs-technological-process-routing.module.ts
  7. 25 0
      src/app/routes/fbs-technological-process/fbs-technological-process.module.ts
  8. 29 0
      src/app/routes/fbs-technological-process/list/list.component.html
  9. 24 0
      src/app/routes/fbs-technological-process/list/list.component.spec.ts
  10. 140 0
      src/app/routes/fbs-technological-process/list/list.component.ts
  11. 39 0
      src/app/routes/fbs-technological-process/update/update.component.html
  12. 24 0
      src/app/routes/fbs-technological-process/update/update.component.spec.ts
  13. 89 0
      src/app/routes/fbs-technological-process/update/update.component.ts
  14. 11 2
      src/app/routes/fbs-workshop-dispatch-list/add/add.component.html
  15. 38 2
      src/app/routes/fbs-workshop-dispatch-list/add/add.component.ts
  16. 3 6
      src/app/routes/fbs-workshop-dispatch-list/list/list.component.html
  17. 6 0
      src/app/routes/fbs-workshop-dispatch-list/update/update.component.html
  18. 3 1
      src/app/routes/fbs-workshop-dispatch-list/update/update.component.ts
  19. 6 0
      src/app/routes/fbs-workshop-dispatch-list/view/view.component.html
  20. 3 1
      src/app/routes/routes-routing.module.ts
  21. 53 0
      src/app/services/fbs/fbs-technological-process.service.ts

+ 15 - 0
src/app/entity/fbs/fbs-technological-process-item.ts

@@ -0,0 +1,15 @@
+import { Page } from '../page';
+
+export class FbsTechnologicalProcessItem extends Page {
+  /**工艺流程子表主键*/
+	id?:string;
+	/**工艺名称*/
+	name?:string;
+	/**排序*/
+	sort?:number;
+	/**备注*/
+  memo?:string;
+  
+  fbsTechnologicalProcessId?:string;
+}
+

+ 15 - 0
src/app/entity/fbs/fbs-technological-process.ts

@@ -0,0 +1,15 @@
+import { Page } from '../page';
+
+export class FbsTechnologicalProcess extends Page{
+  /**工艺流程主键*/
+  id?:string;
+  /**名称*/
+  name?:string;
+  /**排序*/
+  sort?:number;
+  /**备注*/
+  memo?:string;
+
+  //明细
+  fbsTechnologicalProcessItemList?:any[];
+}

+ 39 - 0
src/app/routes/fbs-technological-process/add/add.component.html

@@ -0,0 +1,39 @@
+<nz-spin [nzSpinning]="saveLoading">
+  <form nz-form>
+    <nz-form-item >
+      <nz-form-label [nzSpan]="3">名称</nz-form-label>
+      <nz-form-control [nzSpan]="10">
+        <input nz-input name="name" [(ngModel)]="fbsTechnologicalProcess.name" />
+      </nz-form-control>
+    </nz-form-item>
+  </form>
+
+  <nz-card >
+    <div nz-row [nzGutter]="{xs:12,sm:15,md:29,lg: 36, xl: 40}">
+      <div nz-col nzXs="24" nzSm="4" nzLg="24">
+        <button (click)="addRow()" nz-button nzType="primary">新增</button>
+      </div>
+    </div>
+    <div nz-row [nzGutter]="{xs:12,sm:15,md:29,lg: 36, xl: 40}">
+      <div nz-col nzXs="24" nzSm="4" nzLg="24">
+        <nz-table style="margin-top: 5px;" nzSize="small" #editRowTable nzBordered [nzData]="itemList"
+          [nzShowPagination]="false" [nzFrontPagination]=false>
+          <thead>
+            <tr>
+              <th nzWidth="70%">工艺</th>
+              <th nzWidth="20%">排序</th>
+              <th nzWidth="10%">操作</th>
+            </tr>
+          </thead>
+          <tbody>
+            <tr *ngFor="let data of editRowTable.data">
+              <td><input nz-input name="name" [(ngModel)]="data.name" /></td>
+              <td><input nz-input name="sort" [(ngModel)]="data.sort" /></td>
+              <td><a nz-popconfirm nzTitle="是否删除?" (nzOnConfirm)="deleteRow(data.sort)">删除</a></td>
+            </tr>
+          </tbody>
+        </nz-table>
+      </div>
+    </div>
+  </nz-card>
+</nz-spin>

+ 24 - 0
src/app/routes/fbs-technological-process/add/add.component.spec.ts

@@ -0,0 +1,24 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+import { FbsTechnologicalProcessAddComponent } from './add.component';
+
+describe('FbsTechnologicalProcessAddComponent', () => {
+  let component: FbsTechnologicalProcessAddComponent;
+  let fixture: ComponentFixture<FbsTechnologicalProcessAddComponent>;
+
+  beforeEach(async(() => {
+    TestBed.configureTestingModule({
+      declarations: [ FbsTechnologicalProcessAddComponent ]
+    })
+    .compileComponents();
+  }));
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(FbsTechnologicalProcessAddComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});

+ 67 - 0
src/app/routes/fbs-technological-process/add/add.component.ts

@@ -0,0 +1,67 @@
+import { Component, OnInit } from '@angular/core';
+import { NzModalRef, NzMessageService, NzNotificationService } from 'ng-zorro-antd';
+import { _HttpClient } from '@delon/theme';
+import { FbsTechnologicalProcessService } from 'app/services/fbs/fbs-technological-process.service';
+import { FbsTechnologicalProcess } from 'app/entity/fbs/fbs-technological-process';
+
+@Component({
+  selector: 'app-fbs-technological-process-add',
+  templateUrl: './add.component.html',
+})
+export class FbsTechnologicalProcessAddComponent implements OnInit {
+
+  constructor(
+    private modal: NzModalRef,
+    private fbsTechnologicalProcessService:FbsTechnologicalProcessService,
+    private nzNotificationService:NzNotificationService
+  ) { }
+  saveLoading=false;
+  fbsTechnologicalProcess:FbsTechnologicalProcess={}
+  ngOnInit(): void {
+
+  }
+
+  itemList=[];
+  describeSort=1;
+  addRow(){
+    this.itemList = [
+      ...this.itemList,
+      {
+        name:'',
+        sort: this.describeSort,
+      },
+    ];
+    this.describeSort++;
+  }
+
+  /**
+   * 删除行
+   */
+  deleteRow(sort){
+    this.itemList = this.itemList.filter(d => d.sort !== sort);
+  }
+
+  save(){
+    return new Promise(resolve => {
+      if(this.itemList){
+        this.fbsTechnologicalProcess.fbsTechnologicalProcessItemList=this.itemList
+      }
+      this.fbsTechnologicalProcessService.addAll(this.fbsTechnologicalProcess).then((response)=>{
+        if(response.success){//保存成功
+          this.nzNotificationService.success("保存成功","");
+          this.saveLoading=false;//加载效果关闭
+          this.modal.destroy();
+          resolve();
+        }else{//保存失败
+          this.nzNotificationService.error("保存失败",response.message);
+          this.saveLoading=false;//加载效果关闭
+        }
+      })
+    })
+  }
+
+
+  close() {
+    this.modal.destroy();
+  }
+}

+ 13 - 0
src/app/routes/fbs-technological-process/fbs-technological-process-routing.module.ts

@@ -0,0 +1,13 @@
+import { NgModule } from '@angular/core';
+import { Routes, RouterModule } from '@angular/router';
+import { FbsTechnologicalProcessListComponent } from './list/list.component';
+
+const routes: Routes = [
+
+  { path: 'list', component: FbsTechnologicalProcessListComponent }];
+
+@NgModule({
+  imports: [RouterModule.forChild(routes)],
+  exports: [RouterModule]
+})
+export class FbsTechnologicalProcessRoutingModule { }

+ 25 - 0
src/app/routes/fbs-technological-process/fbs-technological-process.module.ts

@@ -0,0 +1,25 @@
+import { NgModule } from '@angular/core';
+import { SharedModule } from '@shared';
+import { FbsTechnologicalProcessRoutingModule } from './fbs-technological-process-routing.module';
+import { FbsTechnologicalProcessListComponent } from './list/list.component';
+import { FbsTechnologicalProcessAddComponent } from './add/add.component';
+import { FbsTechnologicalProcessUpdateComponent } from './update/update.component';
+
+const COMPONENTS = [
+  FbsTechnologicalProcessListComponent];
+const COMPONENTS_NOROUNT = [
+  FbsTechnologicalProcessAddComponent,
+  FbsTechnologicalProcessUpdateComponent];
+
+@NgModule({
+  imports: [
+    SharedModule,
+    FbsTechnologicalProcessRoutingModule
+  ],
+  declarations: [
+    ...COMPONENTS,
+    ...COMPONENTS_NOROUNT
+  ],
+  entryComponents: COMPONENTS_NOROUNT
+})
+export class FbsTechnologicalProcessModule { }

+ 29 - 0
src/app/routes/fbs-technological-process/list/list.component.html

@@ -0,0 +1,29 @@
+<page-header [action]="phActionTpl">
+  <ng-template #phActionTpl>
+    <button (click)="add()" nz-button nzType="primary">新建</button>
+  </ng-template>
+</page-header>
+<nz-card>
+  <nz-table nzSize="small" class="buttonDistance" [nzData]="dataList" [nzLoading]="isLoading"
+    [nzFrontPagination]="false" #borderedTable [nzTotal]="page.total" [nzPageIndex]="page.current"
+    (nzPageIndexChange)="pageIndexChange($event)">
+    <thead>
+      <tr>
+        <!-- <th>姓名</th> -->
+        <th style="width:85%">名称</th>
+        <th style="width:15%">操作</th>
+      </tr>
+    </thead>
+    <tbody>
+      <tr *ngFor="let item of  borderedTable.data">
+        <td>{{item.name}}</td>
+        <td>
+          <a (click)="update(item)">修改</a>
+          <!-- 删除 -->
+          <span>&nbsp;|&nbsp;</span>
+          <a nz-popconfirm nzTitle="是否删除" nzOkText="是" nzCancelText="否"
+            (nzOnConfirm)="delete(item)">删除</a>
+          </td>
+        </tr>
+    </nz-table>
+</nz-card>

+ 24 - 0
src/app/routes/fbs-technological-process/list/list.component.spec.ts

@@ -0,0 +1,24 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+import { FbsTechnologicalProcessListComponent } from './list.component';
+
+describe('FbsTechnologicalProcessListComponent', () => {
+  let component: FbsTechnologicalProcessListComponent;
+  let fixture: ComponentFixture<FbsTechnologicalProcessListComponent>;
+
+  beforeEach(async(() => {
+    TestBed.configureTestingModule({
+      declarations: [ FbsTechnologicalProcessListComponent ]
+    })
+    .compileComponents();
+  }));
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(FbsTechnologicalProcessListComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});

+ 140 - 0
src/app/routes/fbs-technological-process/list/list.component.ts

@@ -0,0 +1,140 @@
+import { Component, OnInit, ViewChild } from '@angular/core';
+import { _HttpClient, ModalHelper } from '@delon/theme';
+import { STColumn, STComponent } from '@delon/abc';
+import { SFSchema } from '@delon/form';
+import { FbsTechnologicalProcess } from 'app/entity/fbs/fbs-technological-process';
+import { FbsTechnologicalProcessService } from 'app/services/fbs/fbs-technological-process.service';
+import { NzModalService, NzNotificationService } from 'ng-zorro-antd';
+import { FbsTechnologicalProcessAddComponent } from '../add/add.component';
+import { FbsTechnologicalProcessUpdateComponent } from '../update/update.component';
+
+@Component({
+  selector: 'app-fbs-technological-process-list',
+  templateUrl: './list.component.html',
+})
+export class FbsTechnologicalProcessListComponent implements OnInit {
+  
+  constructor(
+    private fbsTechnologicalProcessService:FbsTechnologicalProcessService,
+    private nzModalService:NzModalService,
+    private nzNotificationService:NzNotificationService
+  ) { }
+
+  ngOnInit() {
+    this.getList()
+   }
+
+  dataList = []; //表格数据
+  isLoading = false; //表格加载
+  page = {
+    total: 0,
+    current: 0,
+    size: 0,
+  };
+
+  fbsTechnologicalProcess:FbsTechnologicalProcess={}
+  // 按页码查询
+  pageIndexChange(event) {
+    this.fbsTechnologicalProcess.pageNo = event;
+    //主数据刷新
+    this.getList();
+  }
+
+  /**
+   * 查询主数据
+   */
+  getList(){
+    this.isLoading=true;
+    this.fbsTechnologicalProcessService.list(this.fbsTechnologicalProcess).then((response)=>{
+      if(response.success){//查询成功
+        this.dataList=response.result.records;//表格数据
+        this.page=response.result;//分页数据
+        this.isLoading=false;
+      }
+    })
+  }
+
+  /**
+   * 查询按钮
+   */
+  query(){
+    this.fbsTechnologicalProcess.pageNo=1;
+    //主数据刷新
+    this.getList();
+  }
+
+  
+  add() {
+    const modal = this.nzModalService.create({
+      nzTitle: '新增',
+      nzWidth: "50%",
+      nzContent: FbsTechnologicalProcessAddComponent,
+      nzFooter: [
+        {
+          //取消
+          label: "取消",
+          type: 'default',
+          onClick: model => {
+            model.close();
+          },
+        },
+        {
+          label: '保存',
+          type: 'primary',
+          onClick: model=> {
+            model.save().then(()=>{
+              this.getList()
+            })
+          }
+        }
+      ]
+    });
+  }
+
+  update(item) {
+    const modal = this.nzModalService.create({
+      nzTitle: '修改',
+      nzWidth: "50%",
+      nzContent: FbsTechnologicalProcessUpdateComponent,
+      nzComponentParams: {
+        id: item.id
+      },
+      nzFooter: [
+        {
+          //取消
+          label: "取消",
+          type: 'default',
+          onClick: model => {
+            model.close();
+          },
+        },
+        {
+          label: '保存',
+          type: 'primary',
+          onClick: model=> {
+            model.save().then(()=>{
+              this.getList()
+            })
+          }
+        }
+      ]
+    });
+  }
+
+  delete(item){
+    this.isLoading=true;
+    this.fbsTechnologicalProcessService.delete(item.id).then((response)=>{
+      if(response.success){
+        this.nzNotificationService.success("删除成功","");
+        //刷新list列表
+        this.getList();
+        this.isLoading=false;
+      }else{
+        this.nzNotificationService.success("删除失败",response.message);
+        this.isLoading=false;
+      }
+    })
+  }
+
+
+}

+ 39 - 0
src/app/routes/fbs-technological-process/update/update.component.html

@@ -0,0 +1,39 @@
+<nz-spin [nzSpinning]="saveLoading">
+  <form nz-form>
+    <nz-form-item >
+      <nz-form-label [nzSpan]="3">名称</nz-form-label>
+      <nz-form-control [nzSpan]="10">
+        <input nz-input name="name" [(ngModel)]="fbsTechnologicalProcess.name" />
+      </nz-form-control>
+    </nz-form-item>
+  </form>
+
+  <nz-card >
+    <div nz-row [nzGutter]="{xs:12,sm:15,md:29,lg: 36, xl: 40}">
+      <div nz-col nzXs="24" nzSm="4" nzLg="24">
+        <button (click)="addRow()" nz-button nzType="primary">新增</button>
+      </div>
+    </div>
+    <div nz-row [nzGutter]="{xs:12,sm:15,md:29,lg: 36, xl: 40}">
+      <div nz-col nzXs="24" nzSm="4" nzLg="24">
+        <nz-table style="margin-top: 5px;" nzSize="small" #editRowTable nzBordered [nzData]="itemList"
+          [nzShowPagination]="false" [nzFrontPagination]=false>
+          <thead>
+            <tr>
+              <th nzWidth="70%">工艺</th>
+              <th nzWidth="20%">排序</th>
+              <th nzWidth="10%">操作</th>
+            </tr>
+          </thead>
+          <tbody>
+            <tr *ngFor="let data of editRowTable.data">
+              <td><input nz-input name="name" [(ngModel)]="data.name" /></td>
+              <td><input nz-input name="sort" [(ngModel)]="data.sort" /></td>
+              <td><a nz-popconfirm nzTitle="是否删除?" (nzOnConfirm)="deleteRow(data.sort)">删除</a></td>
+            </tr>
+          </tbody>
+        </nz-table>
+      </div>
+    </div>
+  </nz-card>
+</nz-spin>

+ 24 - 0
src/app/routes/fbs-technological-process/update/update.component.spec.ts

@@ -0,0 +1,24 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+import { FbsTechnologicalProcessUpdateComponent } from './update.component';
+
+describe('FbsTechnologicalProcessUpdateComponent', () => {
+  let component: FbsTechnologicalProcessUpdateComponent;
+  let fixture: ComponentFixture<FbsTechnologicalProcessUpdateComponent>;
+
+  beforeEach(async(() => {
+    TestBed.configureTestingModule({
+      declarations: [ FbsTechnologicalProcessUpdateComponent ]
+    })
+    .compileComponents();
+  }));
+
+  beforeEach(() => {
+    fixture = TestBed.createComponent(FbsTechnologicalProcessUpdateComponent);
+    component = fixture.componentInstance;
+    fixture.detectChanges();
+  });
+
+  it('should create', () => {
+    expect(component).toBeTruthy();
+  });
+});

+ 89 - 0
src/app/routes/fbs-technological-process/update/update.component.ts

@@ -0,0 +1,89 @@
+import { Component, OnInit } from '@angular/core';
+import { NzModalRef, NzMessageService, NzNotificationService } from 'ng-zorro-antd';
+import { _HttpClient } from '@delon/theme';
+import { FbsTechnologicalProcessService } from 'app/services/fbs/fbs-technological-process.service';
+import { FbsTechnologicalProcess } from 'app/entity/fbs/fbs-technological-process';
+import { FbsTechnologicalProcessItem } from 'app/entity/fbs/fbs-technological-process-item';
+
+@Component({
+  selector: 'app-fbs-technological-process-update',
+  templateUrl: './update.component.html',
+})
+export class FbsTechnologicalProcessUpdateComponent implements OnInit {
+  constructor(
+    private modal: NzModalRef,
+    private fbsTechnologicalProcessService:FbsTechnologicalProcessService,
+    private nzNotificationService:NzNotificationService
+  ) { }
+  saveLoading=false;
+  fbsTechnologicalProcess:FbsTechnologicalProcess={}
+  id="";
+  ngOnInit(): void {
+    this.getById();
+  }
+
+  /**
+   * 根据id查询主表以及子表数据
+   */
+  getById(){
+    this.fbsTechnologicalProcessService.getById(this.id).then((response)=>{
+      this.fbsTechnologicalProcess=response.result
+      let fbsTechnologicalProcessItem=new FbsTechnologicalProcessItem();
+      fbsTechnologicalProcessItem.fbsTechnologicalProcessId=this.fbsTechnologicalProcess.id;
+      fbsTechnologicalProcessItem.pageSize=20000;
+      this.fbsTechnologicalProcessService.listItem(fbsTechnologicalProcessItem).then((response)=>{
+        this.itemList=JSON.parse(JSON.stringify(response.result.records))
+        if(this.itemList&&this.itemList.length>0){
+          this.describeSort=this.itemList[this.itemList.length-1].sort+1;
+        }
+      })
+    })
+  }
+
+  /**
+   * 增行按钮
+   */
+  itemList=[];
+  describeSort=1;
+  addRow(){
+    this.itemList = [
+      ...this.itemList,
+      {
+        name:'',
+        sort: this.describeSort,
+      },
+    ];
+    this.describeSort++;
+  }
+
+  /**
+   * 删除行
+   */
+  deleteRow(sort){
+    this.itemList = this.itemList.filter(d => d.sort !== sort);
+  }
+
+  save(){
+    return new Promise(resolve => {
+      if(this.itemList){
+        this.fbsTechnologicalProcess.fbsTechnologicalProcessItemList=this.itemList;
+      }
+      this.fbsTechnologicalProcessService.editAll(this.fbsTechnologicalProcess).then((response)=>{
+        if(response.success){//保存成功
+          this.nzNotificationService.success("保存成功","");
+          this.saveLoading=false;//加载效果关闭
+          this.modal.destroy();
+          resolve();
+        }else{//保存失败
+          this.nzNotificationService.error("保存失败",response.message);
+          this.saveLoading=false;//加载效果关闭
+        }
+      })
+    })
+  }
+
+
+  close() {
+    this.modal.destroy();
+  }
+}

+ 11 - 2
src/app/routes/fbs-workshop-dispatch-list/add/add.component.html

@@ -84,7 +84,7 @@
         <button (click)="workshopDispatchAddRow()" nz-button nzType="primary">新增</button>
         <button (click)="workshopDispatchAddRow()" nz-button nzType="primary">新增</button>
       </div>
       </div>
     </div>
     </div>
-    <nz-table style="margin-top: 5px;" nzSize="small" #editRowTable nzBordered [nzData]="workshopDispatchListList"
+    <nz-table style="margin-top: 5px;" class="tableTdPadding" nzSize="small" #editRowTable nzBordered [nzData]="workshopDispatchListList"
       [nzShowPagination]="false" [nzFrontPagination]=false [nzScroll]="{x:'123vw'}">
       [nzShowPagination]="false" [nzFrontPagination]=false [nzScroll]="{x:'123vw'}">
       <thead>
       <thead>
         <tr>
         <tr>
@@ -101,6 +101,7 @@
           <th nzWidth="6%">计划开工时间</th>
           <th nzWidth="6%">计划开工时间</th>
           <th nzWidth="6%">计划完工时间</th>
           <th nzWidth="6%">计划完工时间</th>
           <th nzWidth="6%">是否可扫码</th>
           <th nzWidth="6%">是否可扫码</th>
+          <th nzWidth="6%">工艺</th>
           <th nzWidth="5%">备注</th>
           <th nzWidth="5%">备注</th>
           <th nzWidth="3%">操作</th>
           <th nzWidth="3%">操作</th>
         </tr>
         </tr>
@@ -167,7 +168,15 @@
                           nzUnCheckedChildren="否">
                           nzUnCheckedChildren="否">
                         </nz-switch>
                         </nz-switch>
           </td>
           </td>
-          <td><textarea rows="2" nz-input [(ngModel)]="data.memo"></textarea></td>
+          <td>
+            <nz-select [(ngModel)]="data.fbsTechnologicalProcessId" style="width: 200px" nzShowSearch nzAllowClear
+              nzPlaceHolder="请选择" (ngModelChange)="fbsTechnologicalProcessChange($event,data)" [nzDropdownMatchSelectWidth]="false">
+              <ng-container *ngFor="let fbsTechnologicalProcess of fbsTechnologicalProcessList">
+                <nz-option nzLabel="{{fbsTechnologicalProcess.name}}" [nzValue]="fbsTechnologicalProcess.id"> </nz-option>
+              </ng-container>
+            </nz-select>
+          </td>
+          <td><textarea rows="1" nz-input [(ngModel)]="data.memo"></textarea></td>
           <td><a nz-popconfirm nzTitle="是否删除?" (nzOnConfirm)="workshopDispatchDeleteRow(data.sort)">删除</a></td>
           <td><a nz-popconfirm nzTitle="是否删除?" (nzOnConfirm)="workshopDispatchDeleteRow(data.sort)">删除</a></td>
         </tr>
         </tr>
       </tbody>
       </tbody>

+ 38 - 2
src/app/routes/fbs-workshop-dispatch-list/add/add.component.ts

@@ -6,6 +6,8 @@ import { FbsWorkshopDispatchListService } from 'app/services/fbs/fbs-workshop-di
 import { DatePipe } from '@angular/common';
 import { DatePipe } from '@angular/common';
 import {setHours} from 'date-fns'
 import {setHours} from 'date-fns'
 import { FbsPersonnelService } from 'app/services/fbs/fbs-personnel.service';
 import { FbsPersonnelService } from 'app/services/fbs/fbs-personnel.service';
+import { FbsTechnologicalProcessService } from 'app/services/fbs/fbs-technological-process.service';
+import { FbsTechnologicalProcess } from 'app/entity/fbs/fbs-technological-process';
 
 
 @Component({
 @Component({
   selector: 'app-fbs-workshop-dispatch-list-add',
   selector: 'app-fbs-workshop-dispatch-list-add',
@@ -34,10 +36,12 @@ export class FbsWorkshopDispatchListAddComponent implements OnInit {
     private fbsWorkshopDispatchListService: FbsWorkshopDispatchListService,
     private fbsWorkshopDispatchListService: FbsWorkshopDispatchListService,
     private nzNotificationService: NzNotificationService,
     private nzNotificationService: NzNotificationService,
     private datePipe:DatePipe,
     private datePipe:DatePipe,
-    private fbsPersonnelService:FbsPersonnelService
+    private fbsPersonnelService:FbsPersonnelService,
+    private fbsTechnologicalProcessService:FbsTechnologicalProcessService
   ) { 
   ) { 
     this.getProperList();
     this.getProperList();
     this.getProductionOrderNumberList();
     this.getProductionOrderNumberList();
+    this.getTechnologicalProcess();
   }
   }
 
 
   ngOnInit(): void {
   ngOnInit(): void {
@@ -66,6 +70,30 @@ export class FbsWorkshopDispatchListAddComponent implements OnInit {
     })
     })
   }
   }
 
 
+
+  /**
+   * 工艺下拉数据
+   */
+  fbsTechnologicalProcessList=[];
+  getTechnologicalProcess(){
+    let fbsTechnologicalProcess=new FbsTechnologicalProcess();
+    fbsTechnologicalProcess.pageSize=20000;
+    this.fbsTechnologicalProcessService.list(fbsTechnologicalProcess).then((response)=>{
+      this.fbsTechnologicalProcessList=JSON.parse(JSON.stringify(response.result.records))
+    })
+  }
+
+  /**
+   * 工艺下拉选择事件
+   */
+  fbsTechnologicalProcessChange(event,data?:any){
+    this.fbsTechnologicalProcessList.forEach(element => {
+      if(event===element.id){
+        data.fbsTechnologicalProcessName=element.name;
+      }
+    });
+  }
+
   /**
   /**
    * 人员下拉款选择事件
    * 人员下拉款选择事件
    */
    */
@@ -161,7 +189,15 @@ export class FbsWorkshopDispatchListAddComponent implements OnInit {
     this.fbsWorkshopDispatchListService.getDispatchNumberByOrderIdProductId(fbsWorkshopDispatchList).then((response)=>{
     this.fbsWorkshopDispatchListService.getDispatchNumberByOrderIdProductId(fbsWorkshopDispatchList).then((response)=>{
       if(response.result){
       if(response.result){
         // data.numberOfTasks=data.plannedQuantity-response.result;
         // data.numberOfTasks=data.plannedQuantity-response.result;
-        data.remainingQuantity=data.plannedQuantity-response.result;
+        var numberOfTasksTotal=0;
+        this.workshopDispatchListList.forEach(element => {
+          if(element.productionOrderNumberId===data.productionOrderNumberId&&element.productId===data.productId){
+              if(element.numberOfTasks){
+                numberOfTasksTotal+=Number(element.numberOfTasks);
+              }
+          }
+        });
+        data.remainingQuantity=data.plannedQuantity-response.result-numberOfTasksTotal;
         //计算标准工时
         //计算标准工时
         this.numberOfTasksChange(data.remainingQuantity,data);
         this.numberOfTasksChange(data.remainingQuantity,data);
       }
       }

+ 3 - 6
src/app/routes/fbs-workshop-dispatch-list/list/list.component.html

@@ -116,6 +116,7 @@
         <th nzAlign="center">达成率</th>
         <th nzAlign="center">达成率</th>
         <th nzAlign="center">生产效率</th>
         <th nzAlign="center">生产效率</th>
         <th nzAlign="center">是否可扫码</th>
         <th nzAlign="center">是否可扫码</th>
+        <th nzAlign="center">工艺进度</th>
         <th>状态</th>
         <th>状态</th>
         <!-- <th>计划开工时间</th>
         <!-- <th>计划开工时间</th>
         <th>计划完工时间</th> -->
         <th>计划完工时间</th> -->
@@ -141,17 +142,12 @@
         <td nzAlign="center">{{item.numberEfficiency}}%</td>
         <td nzAlign="center">{{item.numberEfficiency}}%</td>
         <td nzAlign="center">{{item.workingHoursEfficiency}}%</td>
         <td nzAlign="center">{{item.workingHoursEfficiency}}%</td>
         <td nzAlign="center">
         <td nzAlign="center">
-          <!-- <ng-container *ngIf="item.isScanCode=='1'">
-            是
-          </ng-container>
-          <ng-container *ngIf="item.isScanCode=='2'">
-            否
-          </ng-container> -->
           <nz-switch [(ngModel)]="item.isScanCodeSwith" name="isScanCodeSwith"
           <nz-switch [(ngModel)]="item.isScanCodeSwith" name="isScanCodeSwith"
                           nzCheckedChildren="是"
                           nzCheckedChildren="是"
                           nzUnCheckedChildren="否" (ngModelChange)="isSwitchChange(item)">
                           nzUnCheckedChildren="否" (ngModelChange)="isSwitchChange(item)">
                         </nz-switch>
                         </nz-switch>
         </td>
         </td>
+        <td>{{item.fbsTechnologicalProcessItemName}}</td>
         <td>
         <td>
           <nz-badge nzStatus="yellow" *ngIf="item.state=='0'" nzText="派工"></nz-badge>
           <nz-badge nzStatus="yellow" *ngIf="item.state=='0'" nzText="派工"></nz-badge>
           <nz-badge nzStatus="green" *ngIf="item.state=='1'" nzText="上岗"></nz-badge>
           <nz-badge nzStatus="green" *ngIf="item.state=='1'" nzText="上岗"></nz-badge>
@@ -159,6 +155,7 @@
           <nz-badge nzStatus="green" *ngIf="item.state=='3'&&item.numberOfTasks==item.latestCompletedQuantity" nzText="完工"></nz-badge>
           <nz-badge nzStatus="green" *ngIf="item.state=='3'&&item.numberOfTasks==item.latestCompletedQuantity" nzText="完工"></nz-badge>
           <nz-badge nzStatus="green" *ngIf="item.state=='3'&&item.numberOfTasks!=item.latestCompletedQuantity" nzText="进行中"></nz-badge>
           <nz-badge nzStatus="green" *ngIf="item.state=='3'&&item.numberOfTasks!=item.latestCompletedQuantity" nzText="进行中"></nz-badge>
         </td>
         </td>
+        
         <!-- <td>{{item.plannedStartTime}}</td>
         <!-- <td>{{item.plannedStartTime}}</td>
         <td>{{item.plannedEndTime}}</td> -->
         <td>{{item.plannedEndTime}}</td> -->
         <td>
         <td>

+ 6 - 0
src/app/routes/fbs-workshop-dispatch-list/update/update.component.html

@@ -80,6 +80,12 @@
           </nz-date-picker>
           </nz-date-picker>
         </td>
         </td>
       </tr>
       </tr>
+      <tr>
+        <td>工艺</td>
+        <td>{{fbsWorkshopDispatchList.fbsTechnologicalProcessName}}</td>
+        <td></td>
+        <td></td>
+      </tr>
       <tr>
       <tr>
         <td>备注</td>
         <td>备注</td>
         <td colSpan="3"><textarea rows="2" nz-input [(ngModel)]="fbsWorkshopDispatchList.memo"></textarea></td>
         <td colSpan="3"><textarea rows="2" nz-input [(ngModel)]="fbsWorkshopDispatchList.memo"></textarea></td>

+ 3 - 1
src/app/routes/fbs-workshop-dispatch-list/update/update.component.ts

@@ -150,12 +150,13 @@ export class FbsWorkshopDispatchListUpdateComponent implements OnInit {
       if(response.result){
       if(response.result){
         data.remainingQuantity=data.plannedQuantity-response.result;
         data.remainingQuantity=data.plannedQuantity-response.result;
         //计算标准工时
         //计算标准工时
-        this.numberOfTasksChange(data.remainingQuantity,data);
+        // this.numberOfTasksChange(data.remainingQuantity,data);
       }
       }
     })
     })
   }
   }
 
 
 
 
+
   /**
   /**
    * 派工数量改变
    * 派工数量改变
    */
    */
@@ -181,6 +182,7 @@ export class FbsWorkshopDispatchListUpdateComponent implements OnInit {
         this.fbsWorkshopDispatchList.personnelIds=this.fbsWorkshopDispatchList.personnelIdU8.split(",");//获取修改的多选人员id
         this.fbsWorkshopDispatchList.personnelIds=this.fbsWorkshopDispatchList.personnelIdU8.split(",");//获取修改的多选人员id
         this.remainingQuantity=this.fbsWorkshopDispatchList.remainingQuantity;
         this.remainingQuantity=this.fbsWorkshopDispatchList.remainingQuantity;
         this.productionOrderNumberChange(this.fbsWorkshopDispatchList.productionOrderNumberId);
         this.productionOrderNumberChange(this.fbsWorkshopDispatchList.productionOrderNumberId);
+        this.getDispatchNumberByOrderIdProductId(this.fbsWorkshopDispatchList);
         this.saveLoading=false;
         this.saveLoading=false;
       }else{
       }else{
         this.nzNotificationService.error("查询失败",response.message);
         this.nzNotificationService.error("查询失败",response.message);

+ 6 - 0
src/app/routes/fbs-workshop-dispatch-list/view/view.component.html

@@ -51,6 +51,12 @@
         <td>计划完工时间</td>
         <td>计划完工时间</td>
         <td>{{fbsWorkshopDispatchList.plannedEndTime}}</td>
         <td>{{fbsWorkshopDispatchList.plannedEndTime}}</td>
       </tr>
       </tr>
+      <tr>
+        <td>工艺</td>
+        <td>{{fbsWorkshopDispatchList.fbsTechnologicalProcessName}}</td>
+        <td></td>
+        <td></td>
+      </tr>
       <tr>
       <tr>
         <td >备注</td>
         <td >备注</td>
         <td colSpan="3">{{fbsWorkshopDispatchList.memo}}</td>
         <td colSpan="3">{{fbsWorkshopDispatchList.memo}}</td>

+ 3 - 1
src/app/routes/routes-routing.module.ts

@@ -63,7 +63,9 @@ const routes: Routes = [
       //质量近六个月统计
       //质量近六个月统计
       { path: 'fbs-personnel', loadChildren: './fbs-personnel/fbs-personnel.module#FbsPersonnelModule' },
       { path: 'fbs-personnel', loadChildren: './fbs-personnel/fbs-personnel.module#FbsPersonnelModule' },
       //扫码记录
       //扫码记录
-      { path: 'fbs-fbs-scan-code', loadChildren: './fbs-scan-code/fbs-scan-code.module#FbsScanCodeModule' }
+      { path: 'fbs-fbs-scan-code', loadChildren: './fbs-scan-code/fbs-scan-code.module#FbsScanCodeModule' },
+      //工艺流程档案
+      { path: 'fbs-technological-process', loadChildren: './fbs-technological-process/fbs-technological-process.module#FbsTechnologicalProcessModule' }
     ],
     ],
   },
   },
   // 全屏布局
   // 全屏布局

+ 53 - 0
src/app/services/fbs/fbs-technological-process.service.ts

@@ -0,0 +1,53 @@
+import { Injectable } from '@angular/core';
+import { HttpClient } from '@angular/common/http';
+import { BaseResponse } from 'app/entity/baseResponse';
+import { Result } from 'app/entity/Result';
+import { FbsTechnologicalProcess } from 'app/entity/fbs/fbs-technological-process';
+import { FbsTechnologicalProcessItem } from 'app/entity/fbs/fbs-technological-process-item';
+
+@Injectable({
+  providedIn: 'root'
+})
+export class FbsTechnologicalProcessService {
+
+  constructor(private http:HttpClient) { }
+
+  // 查询
+  async list(body:any): Promise<BaseResponse<Result<FbsTechnologicalProcess[]>>> {
+    return await this.http.get<BaseResponse<Result<FbsTechnologicalProcess[]>>>('/fbsBasedate/fbsTechnologicalProcess/list',{params:body}).toPromise();
+  }
+  // 子表明细查询
+  async listItem(body:any): Promise<BaseResponse<Result<FbsTechnologicalProcessItem[]>>> {
+    return await this.http.get<BaseResponse<Result<FbsTechnologicalProcessItem[]>>>('/fbsBasedate/fbsTechnologicalProcessItem/list',{params:body}).toPromise();
+  }
+
+  // 新增
+  async add(body: FbsTechnologicalProcess): Promise<BaseResponse<FbsTechnologicalProcess>> {
+    return await this.http.post<BaseResponse<FbsTechnologicalProcess>>('/fbsBasedate/fbsTechnologicalProcess/add', body).toPromise();
+  }
+
+  // 修改
+  async edit(body: FbsTechnologicalProcess): Promise<BaseResponse<FbsTechnologicalProcess>> {
+    return await this.http.put<BaseResponse<FbsTechnologicalProcess>>('/fbsBasedate/fbsTechnologicalProcess/edit', body).toPromise();
+  }
+
+  // 通过id删除
+  async delete(id: string): Promise<BaseResponse<FbsTechnologicalProcess>> {
+    return await this.http.delete<BaseResponse<FbsTechnologicalProcess>>('/fbsBasedate/fbsTechnologicalProcess/delete', { params: { id: id } }).toPromise();
+  }
+
+   // 根据id查询
+   async getById(id: string): Promise<BaseResponse<FbsTechnologicalProcess>> {
+    return await this.http.get<BaseResponse<FbsTechnologicalProcess>>("/fbsBasedate/fbsTechnologicalProcess/queryById", { params: { id: id } }).toPromise();
+  }
+
+  // 新增主子表
+  async addAll(body: FbsTechnologicalProcess): Promise<BaseResponse<FbsTechnologicalProcess>> {
+    return await this.http.post<BaseResponse<FbsTechnologicalProcess>>('/fbsBasedate/fbsTechnologicalProcess/addAll', body).toPromise();
+  }
+
+  // 修改主子表
+  async editAll(body: FbsTechnologicalProcess): Promise<BaseResponse<FbsTechnologicalProcess>> {
+    return await this.http.put<BaseResponse<FbsTechnologicalProcess>>('/fbsBasedate/fbsTechnologicalProcess/editAll', body).toPromise();
+  }
+}