瀏覽代碼

采购 收款

chenc 4 年之前
父節點
當前提交
54e975a7ea
共有 44 個文件被更改,包括 2574 次插入101 次删除
  1. 3 1
      src/app/routes/down-payment-management/down-payment-management-routing.module.ts
  2. 8 2
      src/app/routes/down-payment-management/down-payment-management.module.ts
  3. 130 0
      src/app/routes/down-payment-management/payment-slip/add/add.component.html
  4. 24 0
      src/app/routes/down-payment-management/payment-slip/add/add.component.spec.ts
  5. 296 0
      src/app/routes/down-payment-management/payment-slip/add/add.component.ts
  6. 60 0
      src/app/routes/down-payment-management/payment-slip/payment-slip.component.html
  7. 24 0
      src/app/routes/down-payment-management/payment-slip/payment-slip.component.spec.ts
  8. 124 0
      src/app/routes/down-payment-management/payment-slip/payment-slip.component.ts
  9. 130 0
      src/app/routes/down-payment-management/payment-slip/update/update.component.html
  10. 24 0
      src/app/routes/down-payment-management/payment-slip/update/update.component.spec.ts
  11. 318 0
      src/app/routes/down-payment-management/payment-slip/update/update.component.ts
  12. 2 2
      src/app/routes/down-payment-management/receipt/add/add.component.html
  13. 110 41
      src/app/routes/down-payment-management/receipt/add/add.component.ts
  14. 1 0
      src/app/routes/down-payment-management/receipt/receipt.component.html
  15. 6 6
      src/app/routes/down-payment-management/receipt/update/update.component.html
  16. 113 7
      src/app/routes/down-payment-management/receipt/update/update.component.ts
  17. 4 2
      src/app/routes/invoice-management/invoice-manage-purchase/invoice-manage-purchase.component.ts
  18. 5 3
      src/app/routes/invoice-management/invoice-manage-purchase/update/update.component.html
  19. 18 1
      src/app/routes/invoice-management/invoice-manage-purchase/update/update.component.ts
  20. 3 1
      src/app/routes/invoice-management/invoice-management-routing.module.ts
  21. 8 2
      src/app/routes/invoice-management/invoice-management.module.ts
  22. 107 0
      src/app/routes/invoice-management/invoice-sales/add/add.component.html
  23. 24 0
      src/app/routes/invoice-management/invoice-sales/add/add.component.spec.ts
  24. 305 0
      src/app/routes/invoice-management/invoice-sales/add/add.component.ts
  25. 61 0
      src/app/routes/invoice-management/invoice-sales/invoice-sales.component.html
  26. 24 0
      src/app/routes/invoice-management/invoice-sales/invoice-sales.component.spec.ts
  27. 124 0
      src/app/routes/invoice-management/invoice-sales/invoice-sales.component.ts
  28. 107 0
      src/app/routes/invoice-management/invoice-sales/update/update.component.html
  29. 24 0
      src/app/routes/invoice-management/invoice-sales/update/update.component.spec.ts
  30. 329 0
      src/app/routes/invoice-management/invoice-sales/update/update.component.ts
  31. 1 0
      src/app/routes/project-manage-archives/add/add.component.ts
  32. 6 4
      src/app/routes/project-manage-archives/add/development/development.component.html
  33. 1 0
      src/app/routes/project-manage-archives/add/development/development.component.ts
  34. 8 5
      src/app/routes/project-manage-archives/add/implementation/implementation.component.html
  35. 1 0
      src/app/routes/project-manage-archives/add/implementation/implementation.component.ts
  36. 7 5
      src/app/routes/project-manage-archives/add/serviceta/serviceta.component.html
  37. 1 0
      src/app/routes/project-manage-archives/add/serviceta/serviceta.component.ts
  38. 7 5
      src/app/routes/project-manage-archives/update/development/development.component.html
  39. 1 1
      src/app/routes/project-manage-archives/update/essential-information/essential-information.component.html
  40. 8 6
      src/app/routes/project-manage-archives/update/implementation/implementation.component.html
  41. 4 0
      src/app/routes/project-manage-archives/update/implementation/implementation.component.ts
  42. 7 6
      src/app/routes/project-manage-archives/update/serviceta/serviceta.component.html
  43. 1 1
      src/app/routes/project-work/development-log/add/add.component.html
  44. 5 0
      src/app/services/down-payment-management/manager-payment-and-receipt-slip.service.ts

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

@@ -1,10 +1,12 @@
 import { NgModule } from '@angular/core';
 import { Routes, RouterModule } from '@angular/router';
 import { DownPaymentManagementReceiptComponent } from './receipt/receipt.component';
+import { DownPaymentManagementPaymentSlipComponent } from './payment-slip/payment-slip.component';
 
 const routes: Routes = [
 
-  { path: 'receipt', component: DownPaymentManagementReceiptComponent }];
+  { path: 'receipt', component: DownPaymentManagementReceiptComponent },
+  { path: 'payment-slip', component: DownPaymentManagementPaymentSlipComponent }];
 
 @NgModule({
   imports: [RouterModule.forChild(routes)],

+ 8 - 2
src/app/routes/down-payment-management/down-payment-management.module.ts

@@ -4,12 +4,18 @@ import { DownPaymentManagementRoutingModule } from './down-payment-management-ro
 import { DownPaymentManagementReceiptComponent } from './receipt/receipt.component';
 import { DownPaymentManagementReceiptAddComponent } from './receipt/add/add.component';
 import { DownPaymentManagementReceiptUpdateComponent } from './receipt/update/update.component';
+import { DownPaymentManagementPaymentSlipComponent } from './payment-slip/payment-slip.component';
+import { DownPaymentManagementPaymentSlipAddComponent } from './payment-slip/add/add.component';
+import { DownPaymentManagementPaymentSlipUpdateComponent } from './payment-slip/update/update.component';
 
 const COMPONENTS = [
-  DownPaymentManagementReceiptComponent];
+  DownPaymentManagementReceiptComponent,
+  DownPaymentManagementPaymentSlipComponent];
 const COMPONENTS_NOROUNT = [
   DownPaymentManagementReceiptAddComponent,
-  DownPaymentManagementReceiptUpdateComponent];
+  DownPaymentManagementReceiptUpdateComponent,
+  DownPaymentManagementPaymentSlipAddComponent,
+  DownPaymentManagementPaymentSlipUpdateComponent];
 
 @NgModule({
   imports: [

+ 130 - 0
src/app/routes/down-payment-management/payment-slip/add/add.component.html

@@ -0,0 +1,130 @@
+<nz-spin [nzSpinning]="isLoadingSave">
+  <form nz-form [formGroup]="validateForm" (ngSubmit)="submitForm()">
+    <div nz-row [nzGutter]="24">
+      <div nz-col [nzSpan]="6">
+        <nz-form-item>
+          <nz-form-label [nzSm]="6" [nzXs]="24">单据编码</nz-form-label>
+          <nz-form-control [nzSm]="14" [nzXs]="24">
+            自动生成
+          </nz-form-control>
+        </nz-form-item>
+      </div>
+    </div>
+    <div nz-row [nzGutter]="24">
+      <div nz-col [nzSpan]="6">
+        <nz-form-item>
+          <nz-form-label [nzSm]="6" [nzXs]="24">客户编码</nz-form-label>
+          <nz-form-control [nzSm]="14" [nzXs]="24">
+            {{managerPaymentAndReceiptSlip.cusCode}}
+          </nz-form-control>
+        </nz-form-item>
+      </div>
+      <div nz-col [nzSpan]="6">
+        <nz-form-item>
+          <nz-form-label [nzSm]="6" [nzXs]="24">客户名称</nz-form-label>
+          <nz-form-control [nzSm]="14" [nzXs]="24">
+            {{managerPaymentAndReceiptSlip.cusName}}
+          </nz-form-control>
+        </nz-form-item>
+      </div>
+      <div nz-col [nzSpan]="6">
+        <nz-form-item>
+          <nz-form-label [nzSm]="6" [nzXs]="24">项目编码</nz-form-label>
+          <nz-form-control [nzSm]="14" [nzXs]="24">
+            {{managerPaymentAndReceiptSlip.proCode}}
+          </nz-form-control>
+        </nz-form-item>
+      </div>
+      <div nz-col [nzSpan]="6">
+        <nz-form-item>
+          <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>项目名称</nz-form-label>
+          <nz-form-control [nzSm]="14" [nzXs]="24">
+            <nz-select style="widows: 100%;" nzShowSearch nzAllowClear formControlName="proId"
+              id="proId" [(ngModel)]="managerPaymentAndReceiptSlip.proId" nzPlaceHolder="请选择"
+              (ngModelChange)="proChange($event)">
+              <nz-option *ngFor="let i of proList" [nzValue]="i.id" [nzLabel]="i.proName"></nz-option>
+            </nz-select>
+            <nz-form-explain
+              *ngIf="validateForm.get('proId')?.dirty && validateForm.get('proId')?.errors">
+              请选择项目名称
+            </nz-form-explain>
+          </nz-form-control>
+        </nz-form-item>
+      </div>
+    </div>
+  </form>
+<!-- 子表数据 -->
+  <nz-card>
+    <div nz-row [nzGutter]="24">
+      <div nz-col [nzSpan]="24">
+        <!-- 新增按钮 -->
+        <button (click)="addRow()" nz-button nzType="primary">{{ 'button.add' | translate }}</button>
+      </div>
+    </div>
+    <div nz-row [nzGutter]="24">
+      <div nz-col [nzSpan]="24">
+        <nz-table style="padding-top: 5px;" nzSize="small" class="tableTdPadding" #basicTable
+          [nzData]="itemDataList" [nzFrontPagination]="false" [nzShowPagination]="false" >
+          <thead>
+            <tr>
+              <th nzAlign="center">序号</th>
+              <th>收付款条线</th>
+              <th>里程碑</th>
+              <th>收款金额</th>
+              <th>说明</th>
+              <th>对应发票</th>
+              <th>操作</th>
+            </tr>
+          </thead>
+          <tbody>
+            <tr *ngFor="let data of basicTable.data;let i=index">
+              <td nzAlign="center">{{i+1}}</td>
+              <td style="width: 20%;">
+                <nz-select style="width: 100%;" nzShowSearch [(ngModel)]="data.coArchivesId" nzPlaceHolder="请选择" (ngModelChange)="coArchivesIdChange(data)">
+                <nz-option *ngFor="let i of coArchivesList" [nzValue]="i.id" [nzLabel]="i.planName"></nz-option>
+              </nz-select>
+              </td>
+              <td style="width: 20%;">
+                <nz-select style="width: 100%;" nzShowSearch [(ngModel)]="data.proArchivesId" nzPlaceHolder="请选择"
+                (ngModelChange)="proBusinessChange(data)">
+                <nz-option *ngFor="let i of data.proArchivesIdList" [nzValue]="i.mileId" [nzLabel]="i.mileName"></nz-option>
+              </nz-select>
+              </td>
+              <td>
+                <nz-input-number [(ngModel)]="data.coPrvice" [nzMin]="0" [nzStep]="1" [nzFormatter]="formatterDollar" [nzParser]="parserDollar" (ngModelChange)="coPrviceKeyUp()"></nz-input-number>
+              </td>
+              <td>
+                <textarea rows="1" nz-input [(ngModel)]="data.explain"></textarea>
+              </td>
+              <td style="width: 20%;">
+                <nz-select style="width: 100%;" nzShowSearch [(ngModel)]="data.invoiceId" nzPlaceHolder="请选择"
+                >
+                <nz-option *ngFor="let i of invoiceIdList" [nzValue]="i.id" [nzLabel]="i.proName"></nz-option>
+              </nz-select>
+              </td>
+              <td ><a nz-popconfirm nzTitle="是否删除?"
+                  (nzOnConfirm)="deleteRow(data.sort)">{{'table.delete'|translate}}</a></td>
+            </tr>
+            <tr *ngIf="itemDataList&&itemDataList.length>0">
+              <td colSpan="2"></td>
+              <td><strong>收款总金额</strong></td>
+              <td><strong>$ {{managerPaymentAndReceiptSlip.totalPrice}}</strong></td>
+              <td colSpan="3"></td>
+            </tr>
+          </tbody>
+        </nz-table>
+      </div>
+    </div>
+  </nz-card>
+</nz-spin>
+<!-- 按钮 -->
+<div class="base">
+  <!-- 关闭按钮 -->
+  <a nz-popconfirm nzTitle="{{'pm.contract.contract.add.button.cancel'|translate}}" (nzOnConfirm)="close()"
+    style="padding-right: 8px">
+    <button nz-button>{{'pm.quotation.cancel'|translate}}</button>
+  </a>
+  <!-- 保存按钮 -->
+  <button nz-button nzType="primary" class="ant-btn ant-btn-primary" (click)="submitForm()"
+    [nzLoading]="isLoadingSave"><span>{{'pm.finish' | translate}}</span></button>
+</div>

+ 24 - 0
src/app/routes/down-payment-management/payment-slip/add/add.component.spec.ts

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

+ 296 - 0
src/app/routes/down-payment-management/payment-slip/add/add.component.ts

@@ -0,0 +1,296 @@
+import { Component, OnInit } from '@angular/core';
+import { NzModalRef, NzMessageService, NzNotificationService, NzDrawerRef } from 'ng-zorro-antd';
+import { _HttpClient } from '@delon/theme';
+import { FormBuilder, Validators, FormGroup } from '@angular/forms';
+import { ProjectManageArchivesService } from 'app/services/project-manage-archives/project-manage-archives.service';
+import { ManagerPaymentAndReceiptSlipService } from 'app/services/down-payment-management/manager-payment-and-receipt-slip.service';
+import { I18NService } from '@core';
+import { InvoiceManagePurchaseService } from 'app/services/invoice-management/invoice-manage-purchase.service';
+import { ManagerPaymentAndReceiptSlip } from 'app/entity/down-payment-management/manager-payment-and-receipt-slip';
+import { InvoiceManagePurchase } from 'app/entity/invoice-management/invoice-manage-purchase';
+import { ProjectManageArchives } from 'app/entity/project-manage-archives/project-manage-archives';
+
+@Component({
+  selector: 'app-down-payment-management-payment-slip-add',
+  templateUrl: './add.component.html',
+  styles: [
+    `
+      .base {
+        position: absolute;
+        bottom: 0px;
+        width: 100%;
+        border-top: 1px solid rgb(232, 232, 232);
+        padding: 6px 16px;
+        text-align: right;
+        left: 0px;
+        background: #fff;
+        z-index: 99;
+      }
+    `,
+  ],
+})
+export class DownPaymentManagementPaymentSlipAddComponent implements OnInit {
+  constructor(
+    private fb: FormBuilder,
+    private projectManageArchivesService: ProjectManageArchivesService,
+    private managerPaymentAndReceiptSlipService: ManagerPaymentAndReceiptSlipService,
+    private nzNotificationService: NzNotificationService,
+    private i18NService: I18NService,
+    private drawerRef: NzDrawerRef,
+    private invoiceManagePurchaseService:InvoiceManagePurchaseService
+  ) {}
+
+  ngOnInit(): void {
+    //初始化表单
+    this.validateForm = this.fb.group({
+      proId: [null, [Validators.required]],
+    });
+    this.isLoadingSave = true;
+    //项目下拉数据
+    this.getProList().then(()=>{
+      //销售发票下拉数据
+      return this.getInvoiceIdList();
+    }).then(() => {
+      this.isLoadingSave = false;
+    });
+  }
+
+  validateForm!: FormGroup;
+  managerPaymentAndReceiptSlip: ManagerPaymentAndReceiptSlip = {}; //对象
+  isLoadingSave = false;
+  proList = []; //项目下拉数据
+  proArchivesList = []; //里程碑下拉数据
+  coArchivesList = []; //条线下拉数据
+  invoiceIdList = []; //发票数据集合
+  //金额格式化
+  formatterDollar = (value: number) => {
+    if (value) {
+      return `$ ${value}`;
+    } else {
+      return `$ `;
+    }
+  };
+  parserDollar = (value: string) => value.replace('$ ', '');
+  
+  /**
+   * 获取采购发票下拉数据
+   */
+  getInvoiceIdList(){
+    return new Promise((resolve)=>{
+      let invoiceManagePurchase=new InvoiceManagePurchase();
+      invoiceManagePurchase.pageSize=20000;
+      invoiceManagePurchase.type="1";
+      invoiceManagePurchase.pkOrg=sessionStorage.getItem("pkOrg");
+      this.invoiceManagePurchaseService.getList(invoiceManagePurchase).then((response)=>{
+        if(response.success){
+          this.invoiceIdList=response.result.records
+        }
+        resolve();
+      })
+    })
+  }
+
+  /**
+   * 获取项目下拉数据
+   */
+  getProList() {
+    return new Promise(resolve => {
+      let projectManageArchives = new ProjectManageArchives();
+      projectManageArchives.pageSize = 20000;
+      projectManageArchives.pkOrg = sessionStorage.getItem('pkOrg');
+      this.projectManageArchivesService.getList(projectManageArchives).then(response => {
+        if (response.result.records) {
+          this.proList = response.result.records;
+        }
+        resolve();
+      });
+    });
+  }
+
+  /**
+   * 项目下拉选择事件
+   */
+  proChange(event) {
+    if (event) {
+      //根据id获取项目档案数据
+      this.projectManageArchivesService.getListById(event).then(response => {
+        if (response.success) {
+          let project = JSON.parse(JSON.stringify(response.result)); //项目档案对象
+          this.managerPaymentAndReceiptSlip.proCode = project.proCode; //项目档案编码
+          this.managerPaymentAndReceiptSlip.proName = project.proName; //项目档案名称
+          this.managerPaymentAndReceiptSlip.cusId = project.cusId; //客户id
+          this.managerPaymentAndReceiptSlip.cusCode = project.cusCode; //客户编码
+          this.managerPaymentAndReceiptSlip.cusName = project.cusName; //客户名称
+          //获取条线下拉数据
+          this.getLineList();
+        }
+      });
+    }
+  }
+
+  //获取条线下拉数据
+  getLineList() {
+    //查询条件
+    let projectManageArchives = { proArchivesId: this.managerPaymentAndReceiptSlip.proId, planType: '1' };
+    this.projectManageArchivesService.getLineList(projectManageArchives).then(response => {
+      if (response.success) {
+        this.coArchivesList = response.result;
+      }
+    });
+  }
+
+  /**
+   * 条件选择事件
+   * 获取条线名称、获取里程碑数据
+   */
+  coArchivesIdChange(data) {
+    if (data.coArchivesId) {
+      //获取条线名称
+      this.coArchivesList.forEach(element => {
+        if (data.coArchivesId === element.id) {
+          data.coArchivesName = element.planName;
+        }
+      });
+      // //获取里程碑下拉数据
+      this.getMilList(data);
+    }
+  }
+
+  /**
+   * 获取里程碑下拉数据
+   */
+  getMilList(data) {
+    //获取里程碑下拉数据
+    let where = { businessId: data.coArchivesId };
+    this.projectManageArchivesService.getMileNameById(where).then(response => {
+      if (response.success) {
+        data.proArchivesIdList = response.result;
+        //一般用于选择完里程碑又反过来选条线 则重新获取金额
+        if(data.proArchivesId){
+          this.proBusinessChange(data);
+        }
+      }
+    });
+  }
+
+  /**
+   * 里程碑选择事件
+   */
+  proBusinessChange(data) {
+    if (data.proArchivesId) {
+      data.proArchivesIdList.forEach(element => {
+        if (element.mileId === data.proArchivesId) {
+          data.proArchivesMilestone = element.mileName; //名称
+          data.coPrvice = element.price; //金额
+        }
+      });
+      //计算总金额
+    this.getCoPrviceTotal();
+    }
+  }
+
+  itemDataList = []; //子表明细集合
+  /**
+   * 增行按钮
+   */
+  sort = 0;
+  addRow() {
+    this.itemDataList = [
+      ...this.itemDataList,
+      {
+        price: '',
+        uncoPrice: '',
+        coPrice: '',
+        sort: this.sort,
+      },
+    ];
+    this.sort++;
+  }
+
+  /**
+   * 删除行
+   */
+  deleteRow(sort) {
+    this.itemDataList = this.itemDataList.filter(d => d.sort !== sort);
+    //计算总金额
+    this.getCoPrviceTotal();
+  }
+
+  /**
+   * 金额填写事件
+   */
+  coPrviceKeyUp() {
+    //计算总金额
+    this.getCoPrviceTotal();
+  }
+
+  /**
+   * 获取收款金额合计
+   */
+  getCoPrviceTotal() {
+    //判断是否有值
+    if (!this.itemDataList) {
+      return;
+    }
+    //获取所有金额总计
+    let coPrviceTotal = 0;
+    this.itemDataList.forEach(element => {
+      if (element.coPrvice && !isNaN(Number(element.coPrvice))) {
+        coPrviceTotal = coPrviceTotal + Number(element.coPrvice);
+      }
+    });
+    this.managerPaymentAndReceiptSlip.totalPrice = coPrviceTotal;
+  }
+
+  /**
+   * 保存提交
+   */
+  submitForm(): any {
+    return new Promise(resolve => {
+      for (const i in this.validateForm.controls) {
+        this.validateForm.controls[i].markAsDirty();
+        this.validateForm.controls[i].updateValueAndValidity();
+      }
+      let valid = this.validateForm.valid;
+      if (valid) {
+        this.managerPaymentAndReceiptSlip.type = '2'; //付款表
+        this.managerPaymentAndReceiptSlip.pkOrg = sessionStorage.getItem('pkOrg'); //公司组织
+        this.managerPaymentAndReceiptSlip.detailList = this.itemDataList;
+        //子表数据处理
+        if(this.itemDataList&&this.itemDataList.length>0){
+          this.itemDataList.forEach(element => {
+            //获取发票下拉中选中的名称
+            if(element.invoiceId){
+              this.invoiceIdList.forEach(invoice => {
+                if(invoice.id===element.invoiceId){
+                  element.invoice=invoice.proName;
+                }
+              });
+            }
+          });
+        }else {
+          this.nzNotificationService.warning('明细数据必填', '');
+          this.isLoadingSave=false;
+          return;
+        }
+        this.managerPaymentAndReceiptSlipService.add(this.managerPaymentAndReceiptSlip).then(response => {
+          if (response.success) {
+            //保存成功
+            this.isLoadingSave = false;
+            this.nzNotificationService.success(this.i18NService.fanyi('save.ok'), '');
+            this.drawerRef.close(true);
+            resolve();
+          } else {
+            //保存失败
+            this.isLoadingSave = false;
+            this.nzNotificationService.error(this.i18NService.fanyi('save.not'), '');
+          }
+        });
+      }
+    });
+  }
+
+  close() {
+    this.drawerRef.close();
+  }
+}

+ 60 - 0
src/app/routes/down-payment-management/payment-slip/payment-slip.component.html

@@ -0,0 +1,60 @@
+<page-header [action]="phActionTpl">
+  <ng-template #phActionTpl>
+    <button (click)="add()" nz-button nzType="primary">新建</button>
+  </ng-template>
+</page-header>
+<nz-card>
+  <!-- 查询条件 -->
+ <form nz-form>
+  <div nz-row [nzGutter]="{ xs: 8, sm: 16, md: 24, lg: 32 }">
+    <div nz-col [nzSpan]="8">
+      <nz-form-item>
+        <nz-form-label [nzSm]="6" [nzXs]="24">单据编码</nz-form-label>
+        <nz-form-control [nzSm]="14" [nzXs]="24">
+          <input nz-input name="code" [(ngModel)]="managerPaymentAndReceiptSlip.billcode" />
+        </nz-form-control>
+      </nz-form-item>
+    </div>
+    <div nz-col [nzSpan]="8">
+      <nz-form-item>
+        <nz-form-label [nzSm]="2" [nzXs]="24" [nzNoColon]=true></nz-form-label>
+        <nz-form-control [nzSm]="14" [nzXs]="24">
+          <button nzType="primary" (click)="query()" nz-button><span>查询</span></button>
+        </nz-form-control>
+      </nz-form-item>
+    </div>
+  </div>
+</form>
+ <!-- 表格 -->
+ <div nz-row [nzGutter]="{ xs: 8, sm: 16, md: 24, lg: 32 }">
+  <div nz-col [nzSpan]="24">
+    <nz-table nzSize="small" #basicTable [nzData]="listOfData" [nzFrontPagination]="false" [nzTotal]="page.total"
+      [nzPageIndex]="page.current" (nzPageIndexChange)="pageIndexChange($event)" [nzLoading]="isSpinning">
+      <thead>
+        <tr>
+          <th>单据编码</th>
+          <th>客户编码</th>
+          <th>客户名称</th>
+          <th>项目编码</th>
+          <th>项目名称</th>
+          <th>操作</th>
+        </tr>
+      </thead>
+      <tbody>
+        <tr *ngFor="let data of basicTable.data">
+          <td>{{ data.billcode }}</td>
+          <td>{{ data.cusCode }}</td>
+          <td>{{ data.cusName }}</td>
+          <td>{{ data.proCode }}</td>
+          <td>{{ data.proName }}</td>
+          <td>
+            <a (click)="update(data)" acl [acl-ability]="'receipt:update'">修改</a>
+            <nz-divider nzType="vertical" acl [acl-ability]="'receipt:update'"></nz-divider>
+            <a (click)="delete(data.id)" acl [acl-ability]="'receipt:delete'">删除</a>
+          </td>
+        </tr>
+      </tbody>
+    </nz-table>
+  </div>
+</div>
+</nz-card>

+ 24 - 0
src/app/routes/down-payment-management/payment-slip/payment-slip.component.spec.ts

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

+ 124 - 0
src/app/routes/down-payment-management/payment-slip/payment-slip.component.ts

@@ -0,0 +1,124 @@
+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 { ManagerPaymentAndReceiptSlipService } from 'app/services/down-payment-management/manager-payment-and-receipt-slip.service';
+import { NzDrawerService, NzNotificationService } from 'ng-zorro-antd';
+import { I18NService } from '@core';
+import { ManagerPaymentAndReceiptSlip } from 'app/entity/down-payment-management/manager-payment-and-receipt-slip';
+import { DownPaymentManagementPaymentSlipAddComponent } from './add/add.component';
+import { DownPaymentManagementPaymentSlipUpdateComponent } from './update/update.component';
+
+@Component({
+  selector: 'app-down-payment-management-payment-slip',
+  templateUrl: './payment-slip.component.html',
+})
+export class DownPaymentManagementPaymentSlipComponent implements OnInit {
+  
+  constructor(
+    private managerPaymentAndReceiptSlipService:ManagerPaymentAndReceiptSlipService,
+    private nzDrawerService:NzDrawerService,
+    private i18NService:I18NService,
+    private nzNotificationService:NzNotificationService
+  ) { }
+
+  ngOnInit() {
+    this.getList();
+   }
+
+  listOfData = [];
+  managerPaymentAndReceiptSlip: ManagerPaymentAndReceiptSlip = {}; //对象
+  page = {
+    total: 0,
+    current: 0,
+  }; //页码
+  isSpinning = false;
+
+  //按页码显示数据
+  pageIndexChange(event) {
+    this.managerPaymentAndReceiptSlip.pageNo = event; //当前页码
+    this.getList();
+  }
+
+  /**
+   * 查询数据表
+   */
+  getList() {
+    this.isSpinning = true;
+    this.managerPaymentAndReceiptSlip.pkOrg = sessionStorage.getItem('pkOrg'); //组织
+    this.managerPaymentAndReceiptSlip.type = '2'; //付款单
+    this.managerPaymentAndReceiptSlipService.getList(this.managerPaymentAndReceiptSlip).then(response => {
+      this.listOfData = response.result.records;
+      this.isSpinning = false;
+    });
+  }
+
+  /**
+   * 查询按钮
+   */
+  query() {
+    this.managerPaymentAndReceiptSlip.pageNo = 1;
+    this.getList();
+  }
+
+  add() {
+    const drawerRef = this.nzDrawerService.create<DownPaymentManagementPaymentSlipAddComponent, { quotationId: string }, string>({
+      nzTitle: this.i18NService.fanyi("button.add"),//新增标题
+      nzContent: DownPaymentManagementPaymentSlipAddComponent,
+      nzWidth: window.innerWidth,
+      nzBodyStyle: { height: 'calc(100% - 55px)', overflow: 'auto', 'padding-bottom': '53px' }
+      // nzContentParams: {
+      //   //模板id
+      //   quotationId: item.id
+      // }
+    });
+
+    //关闭抽屉的回调
+    drawerRef.afterClose.subscribe((isRefresh) => {
+      if (isRefresh) {//刷新list列表
+        this.getList();
+      }
+    });
+  }
+
+  /**
+   * 修改按钮
+   */
+  update(data){
+    const drawerRef = this.nzDrawerService.create<DownPaymentManagementPaymentSlipUpdateComponent, { id: string }, string>({
+      nzTitle: this.i18NService.fanyi("table.update"),//修改标题
+      nzContent: DownPaymentManagementPaymentSlipUpdateComponent,
+      nzWidth: window.innerWidth,
+      nzBodyStyle: { height: 'calc(100% - 55px)', overflow: 'auto', 'padding-bottom': '53px' },
+      nzContentParams: {
+        //模板id
+        id: data.id
+      }
+    });
+
+    //关闭抽屉的回调
+    drawerRef.afterClose.subscribe((isRefresh) => {
+      if (isRefresh) {//刷新list列表
+        this.getList();
+      }
+    });
+  }
+
+  /**
+   * 删除按钮
+   * @param id 删除id
+   */
+  delete(id){
+    let invoiceManagePurchase={id:id}
+    this.managerPaymentAndReceiptSlipService.delete(invoiceManagePurchase).then((response)=>{
+      if (response.success) {
+        //删除成功
+        this.nzNotificationService.success(this.i18NService.fanyi('successful.deletion'), '');
+        this.getList();
+      } else {
+        //删除失败
+        this.nzNotificationService.error(this.i18NService.fanyi('delete.failed'), '');
+      }
+    })
+  }
+}

+ 130 - 0
src/app/routes/down-payment-management/payment-slip/update/update.component.html

@@ -0,0 +1,130 @@
+<nz-spin [nzSpinning]="isLoadingSave">
+  <form nz-form [formGroup]="validateForm" (ngSubmit)="submitForm()">
+    <div nz-row [nzGutter]="24">
+      <div nz-col [nzSpan]="6">
+        <nz-form-item>
+          <nz-form-label [nzSm]="6" [nzXs]="24">单据编码</nz-form-label>
+          <nz-form-control [nzSm]="14" [nzXs]="24">
+            自动生成
+          </nz-form-control>
+        </nz-form-item>
+      </div>
+    </div>
+    <div nz-row [nzGutter]="24">
+      <div nz-col [nzSpan]="6">
+        <nz-form-item>
+          <nz-form-label [nzSm]="6" [nzXs]="24">客户编码</nz-form-label>
+          <nz-form-control [nzSm]="14" [nzXs]="24">
+            {{managerPaymentAndReceiptSlip.cusCode}}
+          </nz-form-control>
+        </nz-form-item>
+      </div>
+      <div nz-col [nzSpan]="6">
+        <nz-form-item>
+          <nz-form-label [nzSm]="6" [nzXs]="24">客户名称</nz-form-label>
+          <nz-form-control [nzSm]="14" [nzXs]="24">
+            {{managerPaymentAndReceiptSlip.cusName}}
+          </nz-form-control>
+        </nz-form-item>
+      </div>
+      <div nz-col [nzSpan]="6">
+        <nz-form-item>
+          <nz-form-label [nzSm]="6" [nzXs]="24">项目编码</nz-form-label>
+          <nz-form-control [nzSm]="14" [nzXs]="24">
+            {{managerPaymentAndReceiptSlip.proCode}}
+          </nz-form-control>
+        </nz-form-item>
+      </div>
+      <div nz-col [nzSpan]="6">
+        <nz-form-item>
+          <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>项目名称</nz-form-label>
+          <nz-form-control [nzSm]="14" [nzXs]="24">
+            <nz-select style="widows: 100%;" nzShowSearch nzAllowClear formControlName="proId"
+              id="proId" [(ngModel)]="managerPaymentAndReceiptSlip.proId" nzPlaceHolder="请选择"
+              (ngModelChange)="proChange($event)">
+              <nz-option *ngFor="let i of proList" [nzValue]="i.id" [nzLabel]="i.proName"></nz-option>
+            </nz-select>
+            <nz-form-explain
+              *ngIf="validateForm.get('proId')?.dirty && validateForm.get('proId')?.errors">
+              请选择项目名称
+            </nz-form-explain>
+          </nz-form-control>
+        </nz-form-item>
+      </div>
+    </div>
+  </form>
+<!-- 子表数据 -->
+  <nz-card>
+    <div nz-row [nzGutter]="24">
+      <div nz-col [nzSpan]="24">
+        <!-- 新增按钮 -->
+        <button (click)="addRow()" nz-button nzType="primary">{{ 'button.add' | translate }}</button>
+      </div>
+    </div>
+    <div nz-row [nzGutter]="24">
+      <div nz-col [nzSpan]="24">
+        <nz-table style="padding-top: 5px;" nzSize="small" class="tableTdPadding" #basicTable
+          [nzData]="itemDataList" [nzFrontPagination]="false" [nzShowPagination]="false" >
+          <thead>
+            <tr>
+              <th nzAlign="center">序号</th>
+              <th>收付款条线</th>
+              <th>里程碑</th>
+              <th>收款金额</th>
+              <th>说明</th>
+              <th>对应发票</th>
+              <th>操作</th>
+            </tr>
+          </thead>
+          <tbody>
+            <tr *ngFor="let data of basicTable.data;let i=index">
+              <td nzAlign="center">{{i+1}}{{data.sort}}</td>
+              <td style="width: 20%;">
+                <nz-select style="width: 100%;" nzShowSearch [(ngModel)]="data.coArchivesId" nzPlaceHolder="请选择" (ngModelChange)="coArchivesIdChange(data)">
+                <nz-option *ngFor="let i of coArchivesList" [nzValue]="i.id" [nzLabel]="i.planName"></nz-option>
+              </nz-select>
+              </td>
+              <td style="width: 20%;">
+                <nz-select style="width: 100%;" nzShowSearch [(ngModel)]="data.proArchivesId" nzPlaceHolder="请选择"
+                (ngModelChange)="proBusinessChange(data)">
+                <nz-option *ngFor="let i of data.proArchivesIdList" [nzValue]="i.mileId" [nzLabel]="i.mileName"></nz-option>
+              </nz-select>
+              </td>
+              <td>
+                <nz-input-number [(ngModel)]="data.coPrvice" [nzMin]="0" [nzStep]="1" [nzFormatter]="formatterDollar" [nzParser]="parserDollar" (ngModelChange)="coPrviceKeyUp()"></nz-input-number>
+              </td>
+              <td>
+                <textarea rows="1" nz-input [(ngModel)]="data.explain"></textarea>
+              </td>
+              <td style="width: 20%;">
+                <nz-select style="width: 100%;" nzShowSearch [(ngModel)]="data.invoiceId" nzPlaceHolder="请选择"
+                >
+                <nz-option *ngFor="let i of invoiceIdList" [nzValue]="i.id" [nzLabel]="i.proName"></nz-option>
+              </nz-select>
+              </td>
+              <td ><a nz-popconfirm nzTitle="是否删除?"
+                  (nzOnConfirm)="deleteRow(data.sort)">{{'table.delete'|translate}}</a></td>
+            </tr>
+            <tr *ngIf="itemDataList&&itemDataList.length>0">
+              <td colSpan="2"></td>
+              <td><strong>收款总金额</strong></td>
+              <td><strong>$ {{managerPaymentAndReceiptSlip.totalPrice}}</strong></td>
+              <td colSpan="3"></td>
+            </tr>
+          </tbody>
+        </nz-table>
+      </div>
+    </div>
+  </nz-card>
+</nz-spin>
+<!-- 按钮 -->
+<div class="base">
+  <!-- 关闭按钮 -->
+  <a nz-popconfirm nzTitle="{{'pm.contract.contract.add.button.cancel'|translate}}" (nzOnConfirm)="close()"
+    style="padding-right: 8px">
+    <button nz-button>{{'pm.quotation.cancel'|translate}}</button>
+  </a>
+  <!-- 保存按钮 -->
+  <button nz-button nzType="primary" class="ant-btn ant-btn-primary" (click)="submitForm()"
+    [nzLoading]="isLoadingSave"><span>{{'pm.finish' | translate}}</span></button>
+</div>

+ 24 - 0
src/app/routes/down-payment-management/payment-slip/update/update.component.spec.ts

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

+ 318 - 0
src/app/routes/down-payment-management/payment-slip/update/update.component.ts

@@ -0,0 +1,318 @@
+import { Component, OnInit } from '@angular/core';
+import { NzModalRef, NzMessageService, NzNotificationService, NzDrawerRef } from 'ng-zorro-antd';
+import { _HttpClient } from '@delon/theme';
+import { FormBuilder, Validators, FormGroup } from '@angular/forms';
+import { ProjectManageArchivesService } from 'app/services/project-manage-archives/project-manage-archives.service';
+import { ManagerPaymentAndReceiptSlipService } from 'app/services/down-payment-management/manager-payment-and-receipt-slip.service';
+import { I18NService } from '@core';
+import { InvoiceManagePurchaseService } from 'app/services/invoice-management/invoice-manage-purchase.service';
+import { ManagerPaymentAndReceiptSlip } from 'app/entity/down-payment-management/manager-payment-and-receipt-slip';
+import { InvoiceManagePurchase } from 'app/entity/invoice-management/invoice-manage-purchase';
+import { ProjectManageArchives } from 'app/entity/project-manage-archives/project-manage-archives';
+
+@Component({
+  selector: 'app-down-payment-management-payment-slip-update',
+  templateUrl: './update.component.html',
+  styles: [
+    `
+      .base {
+        position: absolute;
+        bottom: 0px;
+        width: 100%;
+        border-top: 1px solid rgb(232, 232, 232);
+        padding: 6px 16px;
+        text-align: right;
+        left: 0px;
+        background: #fff;
+        z-index: 99;
+      }
+    `,
+  ],
+})
+export class DownPaymentManagementPaymentSlipUpdateComponent implements OnInit {
+  constructor(private fb: FormBuilder, private projectManageArchivesService: ProjectManageArchivesService,
+    private managerPaymentAndReceiptSlipService:ManagerPaymentAndReceiptSlipService,
+    private nzNotificationService:NzNotificationService,
+    private i18NService:I18NService,
+    private drawerRef:NzDrawerRef,
+    private invoiceManagePurchaseService:InvoiceManagePurchaseService) {}
+
+  ngOnInit(): void {
+    //初始化表单
+    this.validateForm = this.fb.group({
+      proId: [null, [Validators.required]],
+    });
+    this.isLoadingSave = true;
+    //项目查询
+    this.getById().then(()=>{
+      return this.getProList();//根据id查询修改数据
+    }).then(()=>{
+      return this.getInvoiceIdList();//获取销售下拉数据
+    }).then(() => {
+      this.isLoadingSave = false;
+    });
+  }
+
+  id="";
+  validateForm!: FormGroup;
+  managerPaymentAndReceiptSlip: ManagerPaymentAndReceiptSlip = {}; //对象
+  isLoadingSave = false;
+  proList = []; //项目下拉数据
+  proArchivesList = []; //里程碑下拉数据
+  coArchivesList = []; //条线下拉数据
+  invoiceIdList=[];//发票数据集合
+  //金额格式化
+  formatterDollar = (value: number) => {
+    if (value) {
+      return `$ ${value}`;
+    } else {
+      return `$ `;
+    }
+  };
+  parserDollar = (value: string) => value.replace('$ ', '');
+
+  /**
+   * 获取采购发票下拉数据
+   */
+  getInvoiceIdList(){
+    return new Promise((resolve)=>{
+      let invoiceManagePurchase=new InvoiceManagePurchase();
+      invoiceManagePurchase.pageSize=20000;
+      invoiceManagePurchase.type="1";
+      invoiceManagePurchase.pkOrg=sessionStorage.getItem("pkOrg");
+      this.invoiceManagePurchaseService.getList(invoiceManagePurchase).then((response)=>{
+        if(response.success){
+          this.invoiceIdList=response.result.records
+        }
+        resolve();
+      })
+    })
+  }
+
+  /**
+   * 根据id查询
+   */
+  getById(){
+    return new Promise(resolve => {
+      this.managerPaymentAndReceiptSlipService.queryById(this.id).then((response)=>{
+        if(response.success){
+          this.managerPaymentAndReceiptSlip=response.result;//主表数据
+          this.itemDataList=response.result.detailList;//子表数据
+          if(this.itemDataList){
+            //获取里程碑下拉数据
+            this.itemDataList.forEach(element => {
+              this.getMilList(element)
+            });
+            //获取最大排序
+            this.sort=this.itemDataList.length+1;
+          }
+        }
+        resolve();
+      })
+    })
+  }
+
+  /**
+   * 获取项目下拉数据
+   */
+  getProList() {
+    return new Promise(resolve => {
+      let projectManageArchives = new ProjectManageArchives();
+      projectManageArchives.pageSize = 20000;
+      projectManageArchives.pkOrg = sessionStorage.getItem('pkOrg');
+      this.projectManageArchivesService.getList(projectManageArchives).then(response => {
+        if (response.result.records) {
+          this.proList = response.result.records;
+        }
+        resolve();
+      });
+    });
+  }
+
+  /**
+   * 项目下拉选择事件
+   */
+  proChange(event) {
+    if (event) {
+      //根据id获取项目档案数据
+      this.projectManageArchivesService.getListById(event).then(response => {
+        if (response.success) {
+          let project = JSON.parse(JSON.stringify(response.result)); //项目档案对象
+          this.managerPaymentAndReceiptSlip.proCode = project.proCode; //项目档案编码
+          this.managerPaymentAndReceiptSlip.proName = project.proName; //项目档案名称
+          this.managerPaymentAndReceiptSlip.cusId = project.cusId; //客户id
+          this.managerPaymentAndReceiptSlip.cusCode = project.cusCode; //客户编码
+          this.managerPaymentAndReceiptSlip.cusName = project.cusName; //客户名称
+          //获取条线下拉数据
+          this.getLineList()
+        }
+      });
+    }
+  }
+
+  //获取条线下拉数据
+  getLineList() {
+    //查询条件
+    let projectManageArchives = { proArchivesId: this.managerPaymentAndReceiptSlip.proId, planType: '1' };
+    this.projectManageArchivesService.getLineList(projectManageArchives).then(response => {
+      if (response.success) {
+        this.coArchivesList = response.result;
+      }
+    });
+  }
+
+  /**
+   * 条件选择事件
+   * 获取条线名称、获取里程碑数据
+   */
+  coArchivesIdChange(data) {
+    if (data.coArchivesId) {
+      //获取条线名称
+      this.coArchivesList.forEach(element => {
+        if (data.coArchivesId === element.id) {
+          data.coArchivesName = element.planName;
+        }
+      });
+      // //获取里程碑下拉数据
+      this.getMilList(data);
+    }
+  }
+
+  /**
+   * 获取里程碑下拉数据
+   */
+  getMilList(data) {
+    //获取里程碑下拉数据
+    let where = { businessId: data.coArchivesId };
+    this.projectManageArchivesService.getMileNameById(where).then(response => {
+      if (response.success) {
+        data.proArchivesIdList = response.result;
+        //一般用于选择完里程碑又反过来选条线 则重新获取金额
+        if(data.proArchivesId){
+          this.proBusinessChange(data);
+        }
+      }
+    });
+  }
+
+  /**
+   * 里程碑选择事件
+   */
+  proBusinessChange(data) {
+    if (data.proArchivesId) {
+      data.proArchivesIdList.forEach(element => {
+        if (element.mileId === data.proArchivesId) {
+          data.proArchivesMilestone = element.mileName; //名称
+          data.coPrvice = element.price; //金额
+        }
+      });
+      //计算总金额
+    this.getCoPrviceTotal();
+    }
+  }
+
+  itemDataList = []; //子表明细集合
+  /**
+   * 增行按钮
+   */
+  sort = 0;
+  addRow() {
+    this.itemDataList = [
+      ...this.itemDataList,
+      {
+        price: '',
+        uncoPrice: '',
+        coPrice: '',
+        sort: this.sort,
+      },
+    ];
+    this.sort++;
+  }
+
+  /**
+   * 删除行
+   */
+  deleteRow(sort) {
+    this.itemDataList = this.itemDataList.filter(d => d.sort !== sort);
+    //计算总金额
+    this.getCoPrviceTotal();
+  }
+
+  /**
+   * 金额填写事件
+   */
+  coPrviceKeyUp(){
+    //计算总金额
+    this.getCoPrviceTotal();
+  }
+
+  /**
+   * 获取收款金额合计
+   */
+  getCoPrviceTotal(){
+    //判断是否有值
+    if(!this.itemDataList){
+      return;
+    }
+    //获取所有金额总计
+    let coPrviceTotal=0;
+    this.itemDataList.forEach(element => {
+      if(element.coPrvice&&!isNaN(Number(element.coPrvice))){
+        coPrviceTotal=coPrviceTotal+Number(element.coPrvice);
+      }
+    });
+    this.managerPaymentAndReceiptSlip.totalPrice=coPrviceTotal;
+  }
+
+  /**
+   * 保存提交
+   */
+  submitForm(): any {
+    return new Promise(resolve => {
+      for (const i in this.validateForm.controls) {
+        this.validateForm.controls[i].markAsDirty();
+        this.validateForm.controls[i].updateValueAndValidity();
+      }
+      let valid = this.validateForm.valid;
+      if(valid){
+        this.managerPaymentAndReceiptSlip.type="2";//付款表
+        this.managerPaymentAndReceiptSlip.pkOrg=sessionStorage.getItem("pkOrg");//公司组织
+        this.managerPaymentAndReceiptSlip.detailList=this.itemDataList;
+        //子表数据处理
+        if(this.itemDataList&&this.itemDataList.length>0){
+          this.itemDataList.forEach(element => {
+            //获取发票下拉中选中的名称
+            if(element.invoiceId){
+              this.invoiceIdList.forEach(invoice => {
+                if(invoice.id===element.invoiceId){
+                  element.invoice=invoice.proName;
+                }
+              });
+            }
+          });
+        }else {
+          this.nzNotificationService.warning('明细数据必填', '');
+          this.isLoadingSave=false;
+          return;
+        }
+        this.managerPaymentAndReceiptSlipService.update(this.managerPaymentAndReceiptSlip).then((response)=>{
+          if (response.success) {
+            //保存成功
+            this.isLoadingSave = false;
+            this.nzNotificationService.success(this.i18NService.fanyi('save.ok'), '');
+            this.drawerRef.close(true);
+            resolve();
+          } else {
+            //保存失败
+            this.isLoadingSave = false;
+            this.nzNotificationService.error(this.i18NService.fanyi('save.not'), '');
+          }
+        })
+      }
+    });
+  }
+
+  close() {
+    this.drawerRef.close();
+  }
+}

+ 2 - 2
src/app/routes/down-payment-management/receipt/add/add.component.html

@@ -86,8 +86,8 @@
               </td>
               <td style="width: 20%;">
                 <nz-select style="width: 100%;" nzShowSearch [(ngModel)]="data.proArchivesId" nzPlaceHolder="请选择"
-                >
-                <nz-option *ngFor="let i of proArchivesList" [nzValue]="i.id" [nzLabel]="i.proName"></nz-option>
+                (ngModelChange)="proBusinessChange(data)">
+                <nz-option *ngFor="let i of data.proArchivesIdList" [nzValue]="i.mileId" [nzLabel]="i.mileName"></nz-option>
               </nz-select>
               </td>
               <td>

+ 110 - 41
src/app/routes/down-payment-management/receipt/add/add.component.ts

@@ -7,6 +7,8 @@ import { ProjectManageArchives } from 'app/entity/project-manage-archives/projec
 import { ProjectManageArchivesService } from 'app/services/project-manage-archives/project-manage-archives.service';
 import { ManagerPaymentAndReceiptSlipService } from 'app/services/down-payment-management/manager-payment-and-receipt-slip.service';
 import { I18NService } from '@core';
+import { InvoiceManagePurchase } from 'app/entity/invoice-management/invoice-manage-purchase';
+import { InvoiceManagePurchaseService } from 'app/services/invoice-management/invoice-manage-purchase.service';
 
 @Component({
   selector: 'app-down-payment-management-receipt-add',
@@ -28,11 +30,15 @@ import { I18NService } from '@core';
   ],
 })
 export class DownPaymentManagementReceiptAddComponent implements OnInit {
-  constructor(private fb: FormBuilder, private projectManageArchivesService: ProjectManageArchivesService,
-    private managerPaymentAndReceiptSlipService:ManagerPaymentAndReceiptSlipService,
-    private nzNotificationService:NzNotificationService,
-    private i18NService:I18NService,
-    private drawerRef:NzDrawerRef) {}
+  constructor(
+    private fb: FormBuilder,
+    private projectManageArchivesService: ProjectManageArchivesService,
+    private managerPaymentAndReceiptSlipService: ManagerPaymentAndReceiptSlipService,
+    private nzNotificationService: NzNotificationService,
+    private i18NService: I18NService,
+    private drawerRef: NzDrawerRef,
+    private invoiceManagePurchaseService:InvoiceManagePurchaseService
+  ) {}
 
   ngOnInit(): void {
     //初始化表单
@@ -40,7 +46,11 @@ export class DownPaymentManagementReceiptAddComponent implements OnInit {
       proId: [null, [Validators.required]],
     });
     this.isLoadingSave = true;
-    this.getProList().then(() => {
+    //项目下拉数据
+    this.getProList().then(()=>{
+      //销售发票下拉数据
+      return this.getInvoiceIdList();
+    }).then(() => {
       this.isLoadingSave = false;
     });
   }
@@ -51,7 +61,7 @@ export class DownPaymentManagementReceiptAddComponent implements OnInit {
   proList = []; //项目下拉数据
   proArchivesList = []; //里程碑下拉数据
   coArchivesList = []; //条线下拉数据
-  invoiceIdList=[];//发票数据集合
+  invoiceIdList = []; //发票数据集合
   //金额格式化
   formatterDollar = (value: number) => {
     if (value) {
@@ -61,6 +71,24 @@ export class DownPaymentManagementReceiptAddComponent implements OnInit {
     }
   };
   parserDollar = (value: string) => value.replace('$ ', '');
+  
+  /**
+   * 获取销售发票下拉数据
+   */
+  getInvoiceIdList(){
+    return new Promise((resolve)=>{
+      let invoiceManagePurchase=new InvoiceManagePurchase();
+      invoiceManagePurchase.pageSize=20000;
+      invoiceManagePurchase.type="2";
+      invoiceManagePurchase.pkOrg=sessionStorage.getItem("pkOrg");
+      this.invoiceManagePurchaseService.getList(invoiceManagePurchase).then((response)=>{
+        if(response.success){
+          this.invoiceIdList=response.result.records
+        }
+        resolve();
+      })
+    })
+  }
 
   /**
    * 获取项目下拉数据
@@ -94,46 +122,70 @@ export class DownPaymentManagementReceiptAddComponent implements OnInit {
           this.managerPaymentAndReceiptSlip.cusCode = project.cusCode; //客户编码
           this.managerPaymentAndReceiptSlip.cusName = project.cusName; //客户名称
           //获取条线下拉数据
-          this.getLineList()
+          this.getLineList();
         }
       });
     }
   }
 
   //获取条线下拉数据
-  getLineList(){
+  getLineList() {
     //查询条件
-    let projectManageArchives={proArchivesId:this.managerPaymentAndReceiptSlip.proId,planType:"1"};
-    this.projectManageArchivesService.getLineList(projectManageArchives).then((response)=>{
-      if(response.success){
-        this.coArchivesList=response.result
+    let projectManageArchives = { proArchivesId: this.managerPaymentAndReceiptSlip.proId, planType: '1' };
+    this.projectManageArchivesService.getLineList(projectManageArchives).then(response => {
+      if (response.success) {
+        this.coArchivesList = response.result;
       }
-    })
+    });
   }
 
   /**
    * 条件选择事件
    * 获取条线名称、获取里程碑数据
    */
-  coArchivesIdChange(data){
-    if(data.coArchivesId){
+  coArchivesIdChange(data) {
+    if (data.coArchivesId) {
       //获取条线名称
       this.coArchivesList.forEach(element => {
-        if(data.coArchivesId===element.id){
-          data.coArchivesName=element.planName;
+        if (data.coArchivesId === element.id) {
+          data.coArchivesName = element.planName;
         }
       });
       // //获取里程碑下拉数据
-      // let where={businessId:data.coArchivesId};
-      // this.projectManageArchivesService.getMileNameById(where).then((response)=>{
-      //   if(response.success){
-      //     data.proBusinessList=response.result;
-      //     //一般用于选择完里程碑又反过来选条线 则重新获取金额
-      //     if(data.proBusinessId){
-      //       this.proBusinessChange(data);
-      //     }
-      //   }
-      // })
+      this.getMilList(data);
+    }
+  }
+
+  /**
+   * 获取里程碑下拉数据
+   */
+  getMilList(data) {
+    //获取里程碑下拉数据
+    let where = { businessId: data.coArchivesId };
+    this.projectManageArchivesService.getMileNameById(where).then(response => {
+      if (response.success) {
+        data.proArchivesIdList = response.result;
+        //一般用于选择完里程碑又反过来选条线 则重新获取金额
+        if(data.proArchivesId){
+          this.proBusinessChange(data);
+        }
+      }
+    });
+  }
+
+  /**
+   * 里程碑选择事件
+   */
+  proBusinessChange(data) {
+    if (data.proArchivesId) {
+      data.proArchivesIdList.forEach(element => {
+        if (element.mileId === data.proArchivesId) {
+          data.proArchivesMilestone = element.mileName; //名称
+          data.coPrvice = element.price; //金额
+        }
+      });
+      //计算总金额
+    this.getCoPrviceTotal();
     }
   }
 
@@ -167,7 +219,7 @@ export class DownPaymentManagementReceiptAddComponent implements OnInit {
   /**
    * 金额填写事件
    */
-  coPrviceKeyUp(){
+  coPrviceKeyUp() {
     //计算总金额
     this.getCoPrviceTotal();
   }
@@ -175,19 +227,19 @@ export class DownPaymentManagementReceiptAddComponent implements OnInit {
   /**
    * 获取收款金额合计
    */
-  getCoPrviceTotal(){
+  getCoPrviceTotal() {
     //判断是否有值
-    if(!this.itemDataList){
+    if (!this.itemDataList) {
       return;
     }
     //获取所有金额总计
-    let coPrviceTotal=0;
+    let coPrviceTotal = 0;
     this.itemDataList.forEach(element => {
-      if(element.coPrvice&&!isNaN(Number(element.coPrvice))){
-        coPrviceTotal=coPrviceTotal+Number(element.coPrvice);
+      if (element.coPrvice && !isNaN(Number(element.coPrvice))) {
+        coPrviceTotal = coPrviceTotal + Number(element.coPrvice);
       }
     });
-    this.managerPaymentAndReceiptSlip.totalPrice=coPrviceTotal;
+    this.managerPaymentAndReceiptSlip.totalPrice = coPrviceTotal;
   }
 
   /**
@@ -200,11 +252,28 @@ export class DownPaymentManagementReceiptAddComponent implements OnInit {
         this.validateForm.controls[i].updateValueAndValidity();
       }
       let valid = this.validateForm.valid;
-      if(valid){
-        this.managerPaymentAndReceiptSlip.type="1";//收款表
-        this.managerPaymentAndReceiptSlip.pkOrg=sessionStorage.getItem("pkOrg");//公司组织
-        this.managerPaymentAndReceiptSlip.detailList=this.itemDataList;
-        this.managerPaymentAndReceiptSlipService.add(this.managerPaymentAndReceiptSlip).then((response)=>{
+      if (valid) {
+        this.managerPaymentAndReceiptSlip.type = '1'; //收款表
+        this.managerPaymentAndReceiptSlip.pkOrg = sessionStorage.getItem('pkOrg'); //公司组织
+        this.managerPaymentAndReceiptSlip.detailList = this.itemDataList;
+        //子表数据处理
+        if(this.itemDataList&&this.itemDataList.length>0){
+          this.itemDataList.forEach(element => {
+            //获取发票下拉中选中的名称
+            if(element.invoiceId){
+              this.invoiceIdList.forEach(invoice => {
+                if(invoice.id===element.invoiceId){
+                  element.invoice=invoice.proName;
+                }
+              });
+            }
+          });
+        }else {
+          this.nzNotificationService.warning('明细数据必填', '');
+          this.isLoadingSave=false;
+          return;
+        }
+        this.managerPaymentAndReceiptSlipService.add(this.managerPaymentAndReceiptSlip).then(response => {
           if (response.success) {
             //保存成功
             this.isLoadingSave = false;
@@ -216,7 +285,7 @@ export class DownPaymentManagementReceiptAddComponent implements OnInit {
             this.isLoadingSave = false;
             this.nzNotificationService.error(this.i18NService.fanyi('save.not'), '');
           }
-        })
+        });
       }
     });
   }

+ 1 - 0
src/app/routes/down-payment-management/receipt/receipt.component.html

@@ -1,3 +1,4 @@
+<!-- 收款单 -->
 <page-header [action]="phActionTpl">
   <ng-template #phActionTpl>
     <button (click)="add()" nz-button nzType="primary" acl [acl-ability]="'receipt:add'">新建</button>

+ 6 - 6
src/app/routes/down-payment-management/receipt/update/update.component.html

@@ -68,8 +68,8 @@
           <thead>
             <tr>
               <th nzAlign="center">序号</th>
-              <th>里程碑</th>
               <th>收付款条线</th>
+              <th>里程碑</th>
               <th>收款金额</th>
               <th>说明</th>
               <th>对应发票</th>
@@ -80,14 +80,14 @@
             <tr *ngFor="let data of basicTable.data;let i=index">
               <td nzAlign="center">{{i+1}}{{data.sort}}</td>
               <td style="width: 20%;">
-                <nz-select style="width: 100%;" nzShowSearch [(ngModel)]="data.proArchivesId" nzPlaceHolder="请选择">
-                <nz-option *ngFor="let i of proArchivesList" [nzValue]="i.id" [nzLabel]="i.name"></nz-option>
+                <nz-select style="width: 100%;" nzShowSearch [(ngModel)]="data.coArchivesId" nzPlaceHolder="请选择" (ngModelChange)="coArchivesIdChange(data)">
+                <nz-option *ngFor="let i of coArchivesList" [nzValue]="i.id" [nzLabel]="i.planName"></nz-option>
               </nz-select>
               </td>
               <td style="width: 20%;">
-                <nz-select style="width: 100%;" nzShowSearch [(ngModel)]="data.coArchivesId" nzPlaceHolder="请选择"
-                >
-                <nz-option *ngFor="let i of coArchivesList" [nzValue]="i.id" [nzLabel]="i.proName"></nz-option>
+                <nz-select style="width: 100%;" nzShowSearch [(ngModel)]="data.proArchivesId" nzPlaceHolder="请选择"
+                (ngModelChange)="proBusinessChange(data)">
+                <nz-option *ngFor="let i of data.proArchivesIdList" [nzValue]="i.mileId" [nzLabel]="i.mileName"></nz-option>
               </nz-select>
               </td>
               <td>

+ 113 - 7
src/app/routes/down-payment-management/receipt/update/update.component.ts

@@ -7,6 +7,8 @@ import { ManagerPaymentAndReceiptSlipService } from 'app/services/down-payment-m
 import { I18NService } from '@core';
 import { ManagerPaymentAndReceiptSlip } from 'app/entity/down-payment-management/manager-payment-and-receipt-slip';
 import { ProjectManageArchives } from 'app/entity/project-manage-archives/project-manage-archives';
+import { InvoiceManagePurchase } from 'app/entity/invoice-management/invoice-manage-purchase';
+import { InvoiceManagePurchaseService } from 'app/services/invoice-management/invoice-manage-purchase.service';
 
 @Component({
   selector: 'app-down-payment-management-receipt-update',
@@ -32,7 +34,8 @@ export class DownPaymentManagementReceiptUpdateComponent implements OnInit {
     private managerPaymentAndReceiptSlipService:ManagerPaymentAndReceiptSlipService,
     private nzNotificationService:NzNotificationService,
     private i18NService:I18NService,
-    private drawerRef:NzDrawerRef) {}
+    private drawerRef:NzDrawerRef,
+    private invoiceManagePurchaseService:InvoiceManagePurchaseService) {}
 
   ngOnInit(): void {
     //初始化表单
@@ -41,8 +44,10 @@ export class DownPaymentManagementReceiptUpdateComponent implements OnInit {
     });
     this.isLoadingSave = true;
     //项目查询
-    this.getProList().then(()=>{
-      return this.getById();//根据id查询修改数据
+    this.getById().then(()=>{
+      return this.getProList();//根据id查询修改数据
+    }).then(()=>{
+      return this.getInvoiceIdList();//获取销售下拉数据
     }).then(() => {
       this.isLoadingSave = false;
     });
@@ -66,6 +71,24 @@ export class DownPaymentManagementReceiptUpdateComponent implements OnInit {
   };
   parserDollar = (value: string) => value.replace('$ ', '');
 
+  /**
+   * 获取销售发票下拉数据
+   */
+  getInvoiceIdList(){
+    return new Promise((resolve)=>{
+      let invoiceManagePurchase=new InvoiceManagePurchase();
+      invoiceManagePurchase.pageSize=20000;
+      invoiceManagePurchase.type="2";
+      invoiceManagePurchase.pkOrg=sessionStorage.getItem("pkOrg");
+      this.invoiceManagePurchaseService.getList(invoiceManagePurchase).then((response)=>{
+        if(response.success){
+          this.invoiceIdList=response.result.records
+        }
+        resolve();
+      })
+    })
+  }
+
   /**
    * 根据id查询
    */
@@ -75,7 +98,12 @@ export class DownPaymentManagementReceiptUpdateComponent implements OnInit {
         if(response.success){
           this.managerPaymentAndReceiptSlip=response.result;//主表数据
           this.itemDataList=response.result.detailList;//子表数据
-          if(this.itemDataList){//获取最大排序
+          if(this.itemDataList){
+            //获取里程碑下拉数据
+            this.itemDataList.forEach(element => {
+              this.getMilList(element)
+            });
+            //获取最大排序
             this.sort=this.itemDataList.length+1;
           }
         }
@@ -115,10 +143,71 @@ export class DownPaymentManagementReceiptUpdateComponent implements OnInit {
           this.managerPaymentAndReceiptSlip.cusId = project.cusId; //客户id
           this.managerPaymentAndReceiptSlip.cusCode = project.cusCode; //客户编码
           this.managerPaymentAndReceiptSlip.cusName = project.cusName; //客户名称
-          //获取里程碑下拉数据
-          // this.getBusinessList();
+          //获取条线下拉数据
+          this.getLineList()
+        }
+      });
+    }
+  }
+
+  //获取条线下拉数据
+  getLineList() {
+    //查询条件
+    let projectManageArchives = { proArchivesId: this.managerPaymentAndReceiptSlip.proId, planType: '1' };
+    this.projectManageArchivesService.getLineList(projectManageArchives).then(response => {
+      if (response.success) {
+        this.coArchivesList = response.result;
+      }
+    });
+  }
+
+  /**
+   * 条件选择事件
+   * 获取条线名称、获取里程碑数据
+   */
+  coArchivesIdChange(data) {
+    if (data.coArchivesId) {
+      //获取条线名称
+      this.coArchivesList.forEach(element => {
+        if (data.coArchivesId === element.id) {
+          data.coArchivesName = element.planName;
+        }
+      });
+      // //获取里程碑下拉数据
+      this.getMilList(data);
+    }
+  }
+
+  /**
+   * 获取里程碑下拉数据
+   */
+  getMilList(data) {
+    //获取里程碑下拉数据
+    let where = { businessId: data.coArchivesId };
+    this.projectManageArchivesService.getMileNameById(where).then(response => {
+      if (response.success) {
+        data.proArchivesIdList = response.result;
+        //一般用于选择完里程碑又反过来选条线 则重新获取金额
+        if(data.proArchivesId){
+          this.proBusinessChange(data);
+        }
+      }
+    });
+  }
+
+  /**
+   * 里程碑选择事件
+   */
+  proBusinessChange(data) {
+    if (data.proArchivesId) {
+      data.proArchivesIdList.forEach(element => {
+        if (element.mileId === data.proArchivesId) {
+          data.proArchivesMilestone = element.mileName; //名称
+          data.coPrvice = element.price; //金额
         }
       });
+      //计算总金额
+    this.getCoPrviceTotal();
     }
   }
 
@@ -189,7 +278,24 @@ export class DownPaymentManagementReceiptUpdateComponent implements OnInit {
         this.managerPaymentAndReceiptSlip.type="1";//收款表
         this.managerPaymentAndReceiptSlip.pkOrg=sessionStorage.getItem("pkOrg");//公司组织
         this.managerPaymentAndReceiptSlip.detailList=this.itemDataList;
-        this.managerPaymentAndReceiptSlipService.add(this.managerPaymentAndReceiptSlip).then((response)=>{
+        //子表数据处理
+        if(this.itemDataList&&this.itemDataList.length>0){
+          this.itemDataList.forEach(element => {
+            //获取发票下拉中选中的名称
+            if(element.invoiceId){
+              this.invoiceIdList.forEach(invoice => {
+                if(invoice.id===element.invoiceId){
+                  element.invoice=invoice.proName;
+                }
+              });
+            }
+          });
+        }else {
+          this.nzNotificationService.warning('明细数据必填', '');
+          this.isLoadingSave=false;
+          return;
+        }
+        this.managerPaymentAndReceiptSlipService.update(this.managerPaymentAndReceiptSlip).then((response)=>{
           if (response.success) {
             //保存成功
             this.isLoadingSave = false;

+ 4 - 2
src/app/routes/invoice-management/invoice-manage-purchase/invoice-manage-purchase.component.ts

@@ -14,10 +14,12 @@ import { InvoiceManagementInvoiceManagePurchaseUpdateComponent } from './update/
   templateUrl: './invoice-manage-purchase.component.html',
 })
 export class InvoiceManagementInvoiceManagePurchaseComponent implements OnInit {
-  constructor(private invoiceManagePurchaseService: InvoiceManagePurchaseService,
+  constructor(
+    private invoiceManagePurchaseService: InvoiceManagePurchaseService,
     private nzDrawerService:NzDrawerService,
     private i18NService:I18NService,
-    private nzNotificationService:NzNotificationService) {}
+    private nzNotificationService:NzNotificationService
+    ) {}
 
   ngOnInit() {
     this.getList()

+ 5 - 3
src/app/routes/invoice-management/invoice-manage-purchase/update/update.component.html

@@ -74,13 +74,15 @@
             </nz-select>
             </td>
             <td>
-              <nz-input-number [(ngModel)]="data.price" [nzMin]="0" [nzStep]="1" [nzFormatter]="formatterDollar" [nzParser]="parserDollar"></nz-input-number>
+              <!-- <nz-input-number [(ngModel)]="data.price" [nzMin]="0" [nzStep]="1" [nzFormatter]="formatterDollar" [nzParser]="parserDollar"></nz-input-number> -->
+              {{data.price}}
             </td>
             <td>
-              <nz-input-number [(ngModel)]="data.uncoPrice" [nzMin]="0" [nzStep]="1" [nzFormatter]="formatterDollar" [nzParser]="parserDollar"></nz-input-number>
+              <!-- <nz-input-number [(ngModel)]="data.uncoPrice" [nzMin]="0" [nzStep]="1" [nzFormatter]="formatterDollar" [nzParser]="parserDollar"></nz-input-number> -->
+              {{data.uncoPrice}}
             </td>
             <td>
-              <nz-input-number [(ngModel)]="data.coPrice" [nzMax]="data.uncoPriceMax" [nzMin]="0" [nzStep]="1" [nzFormatter]="formatterDollar" [nzParser]="parserDollar"></nz-input-number>
+              <nz-input-number [(ngModel)]="data.coPrice" [nzMax]="data.uncoPriceMax" [nzMin]="0" [nzStep]="1" [nzFormatter]="formatterDollar" [nzParser]="parserDollar" (ngModelChange)="coPriceKeyUp(data)"></nz-input-number>
             </td>
             <td ><a nz-popconfirm nzTitle="是否删除?"
                 (nzOnConfirm)="deleteRow(data.sort)">{{'table.delete'|translate}}</a></td>

+ 18 - 1
src/app/routes/invoice-management/invoice-manage-purchase/update/update.component.ts

@@ -79,7 +79,9 @@ export class InvoiceManagementInvoiceManagePurchaseUpdateComponent implements On
           this.itemDataList.forEach(element => {
             this.coArchivesChange(element);
             //获取用来计算的未收票金额
-            element.uncoPriceMax=JSON.parse(JSON.stringify(element.uncoPrice))
+            element.uncoPriceMax = JSON.parse(JSON.stringify(element.uncoPrice));
+            //获取用来计算的第一次已开票金额
+            element.oneCoPrice = JSON.parse(JSON.stringify(element.coPrice));
           });
           if (this.itemDataList) {
             //获取最大排序
@@ -221,6 +223,21 @@ export class InvoiceManagementInvoiceManagePurchaseUpdateComponent implements On
     }
   }
 
+  /**
+   * 收票输入事件
+   */
+  coPriceKeyUp(data) {
+    if (data.coPrice) {
+      if (data.id) {
+        //未开票金额减(当前输入的减第一次已开票金额)
+        data.uncoPrice = data.uncoPriceMax - (Number(data.coPrice) - Number(data.oneCoPrice));
+      }else{
+        //未开票金额减已开票金额
+        data.uncoPrice=data.uncoPriceMax-Number(data.coPrice);
+      }
+    }
+  }
+
   /**
    * 增行按钮
    */

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

@@ -1,10 +1,12 @@
 import { NgModule } from '@angular/core';
 import { Routes, RouterModule } from '@angular/router';
 import { InvoiceManagementInvoiceManagePurchaseComponent } from './invoice-manage-purchase/invoice-manage-purchase.component';
+import { InvoiceManagementInvoiceSalesComponent } from './invoice-sales/invoice-sales.component';
 
 const routes: Routes = [
 
-  { path: 'invoice-manage-purchase', component: InvoiceManagementInvoiceManagePurchaseComponent }];
+  { path: 'invoice-manage-purchase', component: InvoiceManagementInvoiceManagePurchaseComponent },
+  { path: 'invoice-sales', component: InvoiceManagementInvoiceSalesComponent }];
 
 @NgModule({
   imports: [RouterModule.forChild(routes)],

+ 8 - 2
src/app/routes/invoice-management/invoice-management.module.ts

@@ -4,12 +4,18 @@ import { InvoiceManagementRoutingModule } from './invoice-management-routing.mod
 import { InvoiceManagementInvoiceManagePurchaseComponent } from './invoice-manage-purchase/invoice-manage-purchase.component';
 import { InvoiceManagementInvoiceManagePurchaseAddComponent } from './invoice-manage-purchase/add/add.component';
 import { InvoiceManagementInvoiceManagePurchaseUpdateComponent } from './invoice-manage-purchase/update/update.component';
+import { InvoiceManagementInvoiceSalesComponent } from './invoice-sales/invoice-sales.component';
+import { InvoiceManagementInvoiceSalesAddComponent } from './invoice-sales/add/add.component';
+import { InvoiceManagementInvoiceSalesUpdateComponent } from './invoice-sales/update/update.component';
 
 const COMPONENTS = [
-  InvoiceManagementInvoiceManagePurchaseComponent];
+  InvoiceManagementInvoiceManagePurchaseComponent,
+  InvoiceManagementInvoiceSalesComponent];
 const COMPONENTS_NOROUNT = [
   InvoiceManagementInvoiceManagePurchaseAddComponent,
-  InvoiceManagementInvoiceManagePurchaseUpdateComponent];
+  InvoiceManagementInvoiceManagePurchaseUpdateComponent,
+  InvoiceManagementInvoiceSalesAddComponent,
+  InvoiceManagementInvoiceSalesUpdateComponent];
 
 @NgModule({
   imports: [

+ 107 - 0
src/app/routes/invoice-management/invoice-sales/add/add.component.html

@@ -0,0 +1,107 @@
+<nz-spin [nzSpinning]="isLoadingSave">
+  <form nz-form [formGroup]="validateForm" (ngSubmit)="submitForm()">
+    <div nz-row [nzGutter]="24">
+      <div nz-col [nzSpan]="8">
+        <nz-form-item>
+          <nz-form-label [nzSm]="6" [nzXs]="24">单据编码</nz-form-label>
+          <nz-form-control [nzSm]="14" [nzXs]="24">
+            自动生成
+          </nz-form-control>
+        </nz-form-item>
+      </div>
+      <div nz-col [nzSpan]="8">
+        <nz-form-item>
+          <nz-form-label [nzSm]="6" [nzXs]="24">项目编码</nz-form-label>
+          <nz-form-control [nzSm]="14" [nzXs]="24">
+            {{invoiceManagePurchase.proCode}}
+          </nz-form-control>
+        </nz-form-item>
+      </div>
+      <div nz-col [nzSpan]="8">
+        <nz-form-item>
+          <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>项目名称</nz-form-label>
+          <nz-form-control [nzSm]="14" [nzXs]="24">
+            <nz-select style="widows: 100%;" nzShowSearch nzAllowClear formControlName="proArchivesId"
+              id="proArchivesId" [(ngModel)]="invoiceManagePurchase.proArchivesId" nzPlaceHolder="请选择"
+              (ngModelChange)="proChange($event)">
+              <nz-option *ngFor="let i of proList" [nzValue]="i.id" [nzLabel]="i.proName"></nz-option>
+            </nz-select>
+            <nz-form-explain
+              *ngIf="validateForm.get('proArchivesId')?.dirty && validateForm.get('proArchivesId')?.errors">
+              请选择项目名称
+            </nz-form-explain>
+          </nz-form-control>
+        </nz-form-item>
+      </div>
+    </div>
+  </form>
+
+
+<nz-card>
+  <div nz-row [nzGutter]="24">
+    <div nz-col [nzSpan]="24">
+      <!-- 新增按钮 -->
+      <button (click)="addRow()" nz-button nzType="primary">{{ 'button.add' | translate }}</button>
+    </div>
+  </div>
+  <div nz-row [nzGutter]="24">
+    <div nz-col [nzSpan]="24">
+      <nz-table style="padding-top: 5px;" nzSize="small" class="tableTdPadding" #basicTable
+        [nzData]="itemDataList" [nzFrontPagination]="false" [nzShowPagination]="false" >
+        <thead>
+          <tr>
+            <th nzAlign="center">序号</th>
+            <th>首付款条线</th>
+            <th>里程碑</th>
+            <th>金额</th>
+            <th>未收票金额</th>
+            <th>本次收票金额</th>
+            <th>操作</th>
+          </tr>
+        </thead>
+        <tbody>
+          <tr *ngFor="let data of basicTable.data;let i=index">
+            <td nzAlign="center">{{i+1}}</td>
+            <td style="width: 20%;">
+              <nz-select style="width: 100%;" nzShowSearch [(ngModel)]="data.coArchivesId" nzPlaceHolder="请选择" (ngModelChange)="coArchivesChange(data)">
+              <nz-option *ngFor="let i of coArchivesList" [nzValue]="i.id" [nzLabel]="i.planName" ></nz-option>
+            </nz-select>
+            </td>
+            <td style="width: 20%;" >
+              <nz-select style="width: 100%;" nzShowSearch [(ngModel)]="data.proBusinessId" nzPlaceHolder="请选择"
+              (ngModelChange)="proBusinessChange(data)">
+              <nz-option *ngFor="let i of data.proBusinessList" [nzValue]="i.mileId" [nzLabel]="i.mileName"></nz-option>
+            </nz-select>
+            </td>
+            <td>
+              <!-- <nz-input-number [(ngModel)]="data.price" [nzMin]="0" [nzStep]="1" [nzFormatter]="formatterDollar" [nzParser]="parserDollar"></nz-input-number> -->
+              {{data.price}}
+            </td>
+            <td>
+              <!-- <nz-input-number [(ngModel)]="data.uncoPrice" [nzMin]="0" [nzStep]="1" [nzFormatter]="formatterDollar" [nzParser]="parserDollar"></nz-input-number> -->
+              {{data.uncoPrice}}
+            </td>
+            <td>
+              <nz-input-number [(ngModel)]="data.coPrice" [nzMin]="0" [nzMax]="data.uncoPriceMax" [nzStep]="1" [nzFormatter]="formatterDollar" [nzParser]="parserDollar" (ngModelChange)="coPriceKeyUp(data)"></nz-input-number>
+            </td>
+            <td ><a nz-popconfirm nzTitle="是否删除?"
+                (nzOnConfirm)="deleteRow(data.sort)">{{'table.delete'|translate}}</a></td>
+          </tr>
+        </tbody>
+      </nz-table>
+    </div>
+  </div>
+</nz-card>
+</nz-spin>
+<!-- 按钮 -->
+<div class="base">
+  <strong>填写人:</strong>{{invoiceManagePurchase.currentUser}} <strong>填写时间:</strong>{{invoiceManagePurchase.createTime}}
+  <!-- 关闭按钮 -->
+  <a nz-popconfirm nzTitle="{{'pm.contract.contract.add.button.cancel'|translate}}" (nzOnConfirm)="close()"
+    style="padding-right: 8px">
+    <button nz-button>{{'pm.quotation.cancel'|translate}}</button>
+  </a>
+  <!-- 保存按钮 -->
+  <button nz-button nzType="primary" class="ant-btn ant-btn-primary" (click)="submitForm()"
+    [nzLoading]="isLoadingSave"><span>{{'pm.finish' | translate}}</span></button>
+</div>

+ 24 - 0
src/app/routes/invoice-management/invoice-sales/add/add.component.spec.ts

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

+ 305 - 0
src/app/routes/invoice-management/invoice-sales/add/add.component.ts

@@ -0,0 +1,305 @@
+import { Component, OnInit } from '@angular/core';
+import { NzModalRef, NzMessageService, NzNotificationService, NzDrawerRef } from 'ng-zorro-antd';
+import { _HttpClient, SettingsService } from '@delon/theme';
+import { FormBuilder, Validators, FormGroup } from '@angular/forms';
+import { DatePipe } from '@angular/common';
+import { ProjectManageArchivesService } from 'app/services/project-manage-archives/project-manage-archives.service';
+import { BaseArchivesCollectionLineService } from 'app/services/basedata/base-archives-collection-line.service';
+import { InvoiceManagePurchaseService } from 'app/services/invoice-management/invoice-manage-purchase.service';
+import { I18NService } from '@core';
+import { InvoiceManagePurchase } from 'app/entity/invoice-management/invoice-manage-purchase';
+import { ProjectManageArchives } from 'app/entity/project-manage-archives/project-manage-archives';
+
+@Component({
+  selector: 'app-invoice-management-invoice-sales-add',
+  templateUrl: './add.component.html',
+  styles: [
+    `
+      .base {
+        position: absolute;
+        bottom: 0px;
+        width: 100%;
+        border-top: 1px solid rgb(232, 232, 232);
+        padding: 6px 16px;
+        text-align: right;
+        left: 0px;
+        background: #fff;
+        z-index: 99;
+      }
+    `,
+  ],
+})
+export class InvoiceManagementInvoiceSalesAddComponent implements OnInit {
+  constructor(
+    private fb: FormBuilder,
+    private settingsService: SettingsService,
+    private datePipe: DatePipe,
+    private projectManageArchivesService: ProjectManageArchivesService,
+    private baseArchivesCollectionLineService:BaseArchivesCollectionLineService,
+    private nzNotificationService:NzNotificationService,
+    private drawerRef:NzDrawerRef,
+    private invoiceManagePurchaseService:InvoiceManagePurchaseService,
+    private i18NService:I18NService
+  ) {}
+
+  ngOnInit(): void {
+    //初始化表单
+    this.validateForm = this.fb.group({
+      proArchivesId: [null, [Validators.required]],
+    });
+
+    //项目下拉数据
+    this.isLoadingSave = true;
+    this.getProList().then(()=>{
+      this.isLoadingSave = false;
+    });
+  }
+  validateForm!: FormGroup;
+  invoiceManagePurchase: InvoiceManagePurchase = {
+    currentUser: this.settingsService.user.realname,
+    createTime: this.datePipe.transform(new Date(), 'yyyy-MM-dd HH:mm:ss'),
+  }; //对象
+  isLoadingSave = false;
+  proList = []; //项目下拉数据
+  itemDataList=[];//明细表格数据集合
+  coArchivesList=[];//条线档案数据集合
+
+  /**
+   * 获取项目下拉数据
+   */
+  getProList() {
+    return new Promise(resolve => {
+      let projectManageArchives = new ProjectManageArchives();
+      projectManageArchives.pageSize = 20000;
+      projectManageArchives.pkOrg = sessionStorage.getItem('pkOrg');
+      this.projectManageArchivesService.getList(projectManageArchives).then(response => {
+        if (response.result.records) {
+          this.proList = response.result.records;
+        }
+        resolve();
+      });
+    });
+  }
+
+  /**
+   * 获取条线下拉数据
+   */
+  // getCoArchivesList(){
+  //   return new Promise(resolve => {
+  //     let baseArchivesCollectionLine = new BaseArchivesCollectionLine();
+  //     baseArchivesCollectionLine.pageSize = 20000;
+  //     baseArchivesCollectionLine.pkOrg = sessionStorage.getItem('pkOrg');
+  //     this.baseArchivesCollectionLineService.getList(baseArchivesCollectionLine).then(response => {
+  //       if (response.result.records) {
+  //         this.coArchivesList = response.result.records;
+  //       }
+  //       resolve();
+  //     });
+  //   });
+  // }
+
+
+
+  /**
+   * 项目下拉选择事件
+   * 获取条线下拉数据
+   */
+  proChange(event) {
+    if (event) {
+      //根据id获取项目档案数据
+      this.projectManageArchivesService.getListById(event).then(response => {
+        if (response.success) {
+          let project = JSON.parse(JSON.stringify(response.result)); //项目档案对象
+          this.invoiceManagePurchase.proCode = project.proCode; //项目档案编码
+          this.invoiceManagePurchase.proName = project.proName; //项目档案名称
+          //获取首付款条线
+          this.getLineList();
+        }
+      });
+    }
+  }
+
+  //获取条线下拉数据
+  getLineList(){
+    //查询条件
+    let projectManageArchives={proArchivesId:this.invoiceManagePurchase.proArchivesId,planType:"1"};
+    this.projectManageArchivesService.getLineList(projectManageArchives).then((response)=>{
+      if(response.success){
+        this.coArchivesList=response.result
+      }
+    })
+  }
+
+  /**
+   * 条线下拉选择事件
+   * 获取名称和里程碑下拉数据
+   */
+  coArchivesChange(data){
+    if(data.coArchivesId){
+      //获取条线名称
+      this.coArchivesList.forEach(element => {
+        if(data.coArchivesId===element.id){
+          data.coArchivesName=element.planName;
+        }
+      });
+      //获取里程碑下拉数据
+      let where={businessId:data.coArchivesId};
+      this.projectManageArchivesService.getMileNameById(where).then((response)=>{
+        if(response.success){
+          data.proBusinessList=response.result;
+          //一般用于选择完里程碑又反过来选条线 则重新获取金额
+          if(data.proBusinessId){
+            this.proBusinessChange(data);
+          }
+        }
+      })
+    }
+    
+  }
+
+  /**
+   * 里程碑选择事件
+   * 获取名称和金额
+   */
+  uncoPrice=0;//未收票金额
+  proBusinessChange(data){
+    if(data.proBusinessId){
+      data.proBusinessList.forEach(element => {
+        if(element.mileId===data.proBusinessId){
+          data.proArchivesMilestone=element.mileName;//名称
+          data.price=element.price;//金额
+          
+        }
+      });
+      //查询条件
+      let where={coArchivesId:data.coArchivesId,proBusinessId:data.proBusinessId}
+      //获取未开票金额
+      this.invoiceManagePurchaseService.getChildrenList(where).then((response)=>{
+        if(response.success){
+          if(response.result.uncoPrice){
+            data.uncoPrice=response.result.uncoPrice;//未收票金额
+            data.uncoPriceMax=Number(response.result.uncoPrice);//未收票金额
+          }else{
+            data.uncoPrice=JSON.parse(JSON.stringify(data.price));//未收票金额
+            data.uncoPriceMax=Number(JSON.parse(JSON.stringify(data.price)));//未收票金额
+          }
+        }
+        
+      })
+    }
+  }
+
+  /**
+   * 收票输入事件
+   */
+  coPriceKeyUp(data){
+    if(data.coPrice){
+      //未开票金额减已开票金额
+      data.uncoPrice=data.uncoPriceMax-Number(data.coPrice);
+    }
+  }
+
+  /**
+   * 获取里程碑下拉数据
+   */
+  proBusinessList=[];//里程碑下拉数据
+  // getBusinessList(){
+  //   //查询条件:项目档案id、计划类型
+  //   let business={businessId:this.invoiceManagePurchase.proArchivesId,planType:"1"}
+  //   this.projectManageArchivesService.getMileNameById(business).then((response)=>{
+  //     if(response.success){
+  //       this.proBusinessList=response.result;
+  //     }
+  //   })
+  // }
+
+  /**
+   * 增行按钮
+   */
+  sort = 0;
+  addRow() {
+    this.itemDataList = [
+      ...this.itemDataList,
+      {
+        price:"",
+        uncoPrice:"",
+        coPrice:"",
+        sort: this.sort
+      },
+    ];
+    this.sort++;
+  }
+
+  /**
+   * 删除行
+   */
+  deleteRow(sort) {
+    this.itemDataList = this.itemDataList.filter(d => d.sort !== sort);
+  }
+
+  //金额格式化
+  formatterDollar = (value: number) => {
+    if(value){
+      return  `$ ${value}`;
+    }else{
+      return  `$ `;
+    }
+  };
+  parserDollar = (value: string) => value.replace('$ ', '');
+
+  /**
+   * 提交保存按钮
+   */
+  submitForm(): any {
+    return new Promise(resolve => {
+      for (const i in this.validateForm.controls) {
+        this.validateForm.controls[i].markAsDirty();
+        this.validateForm.controls[i].updateValueAndValidity();
+      }
+      let valid = this.validateForm.valid;
+      if(valid){
+        this.isLoadingSave=true;
+        this.invoiceManagePurchase.type="2";//销售
+        this.invoiceManagePurchase.pkOrg=sessionStorage.getItem("pkOrg");
+        //子表保存数据处理
+        if(this.itemDataList&&this.itemDataList.length>0){
+          this.itemDataList.forEach(element => {
+            //获取条线名称
+            if(element.coArchivesId){
+              this.coArchivesList.forEach(coArchives => {
+                if(coArchives.id==element.coArchivesId){
+                  element.coArchivesName=coArchives.name
+                }
+              });
+            }else{
+              element.coArchivesName="";
+            }
+          });
+        }else{
+          //是否填写明细数据
+          this.nzNotificationService.warning("填写明细数据","");
+          this.isLoadingSave=false;
+          return;
+        }
+        this.invoiceManagePurchase.detailList=this.itemDataList;
+        this.invoiceManagePurchaseService.add(this.invoiceManagePurchase).then((response)=>{
+          if (response.success) {
+            //保存成功
+            this.isLoadingSave = false;
+            this.nzNotificationService.success(this.i18NService.fanyi('save.ok'), '');
+            this.drawerRef.close(true);
+            resolve();
+          } else {
+            //保存失败
+            this.isLoadingSave = false;
+            this.nzNotificationService.error(this.i18NService.fanyi('save.not'), '');
+          }
+        })
+      }
+    });
+  }
+
+  close() {
+    this.drawerRef.close();
+  }
+}

+ 61 - 0
src/app/routes/invoice-management/invoice-sales/invoice-sales.component.html

@@ -0,0 +1,61 @@
+<!-- 销售发票 -->
+<page-header [action]="phActionTpl">
+  <ng-template #phActionTpl>
+    <button (click)="add()" nz-button nzType="primary"  acl [acl-ability]="'invoice-sales:add'">新建</button>
+  </ng-template>
+</page-header>
+<nz-card>
+  <!-- 查询条件 -->
+ <form nz-form>
+  <div nz-row [nzGutter]="{ xs: 8, sm: 16, md: 24, lg: 32 }">
+    <div nz-col [nzSpan]="8">
+      <nz-form-item>
+        <nz-form-label [nzSm]="6" [nzXs]="24">单据编码</nz-form-label>
+        <nz-form-control [nzSm]="14" [nzXs]="24">
+          <input nz-input name="code" [(ngModel)]="invoiceManagePurchase.billcode" />
+        </nz-form-control>
+      </nz-form-item>
+    </div>
+    <div nz-col [nzSpan]="8">
+      <nz-form-item>
+        <nz-form-label [nzSm]="2" [nzXs]="24" [nzNoColon]=true></nz-form-label>
+        <nz-form-control [nzSm]="14" [nzXs]="24">
+          <button nzType="primary" (click)="query()" nz-button><span>查询</span></button>
+        </nz-form-control>
+      </nz-form-item>
+    </div>
+  </div>
+</form>
+ <!-- 表格 -->
+ <div nz-row [nzGutter]="{ xs: 8, sm: 16, md: 24, lg: 32 }">
+  <div nz-col [nzSpan]="24">
+    <nz-table nzSize="small" #basicTable [nzData]="listOfData" [nzFrontPagination]="false" [nzTotal]="page.total"
+      [nzPageIndex]="page.current" (nzPageIndexChange)="pageIndexChange($event)" [nzLoading]="isSpinning">
+      <thead>
+        <tr>
+          <th>单据编码</th>
+          <th>项目编码</th>
+          <th>项目名称</th>
+          <th>填写人</th>
+          <th>填写时间</th>
+          <th>操作</th>
+        </tr>
+      </thead>
+      <tbody>
+        <tr *ngFor="let data of basicTable.data">
+          <td>{{ data.billcode }}</td>
+          <td>{{ data.proCode }}</td>
+          <td>{{ data.proName }}</td>
+          <td>{{ data.currentUser }}</td>
+          <td>{{ data.createTime }}</td>
+          <td>
+            <a (click)="update(data)" acl [acl-ability]="'invoice-sales:update'">修改</a>
+            <nz-divider nzType="vertical" acl [acl-ability]="'invoice-sales:update'"></nz-divider>
+            <a (click)="delete(data.id)" acl [acl-ability]="'invoice-sales:delete'">删除</a>
+          </td>
+        </tr>
+      </tbody>
+    </nz-table>
+  </div>
+</div>
+</nz-card>

+ 24 - 0
src/app/routes/invoice-management/invoice-sales/invoice-sales.component.spec.ts

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

+ 124 - 0
src/app/routes/invoice-management/invoice-sales/invoice-sales.component.ts

@@ -0,0 +1,124 @@
+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 { InvoiceManagePurchaseService } from 'app/services/invoice-management/invoice-manage-purchase.service';
+import { NzDrawerService, NzNotificationService } from 'ng-zorro-antd';
+import { I18NService } from '@core';
+import { InvoiceManagePurchase } from 'app/entity/invoice-management/invoice-manage-purchase';
+import { InvoiceManagementInvoiceSalesAddComponent } from './add/add.component';
+import { InvoiceManagementInvoiceSalesUpdateComponent } from './update/update.component';
+
+@Component({
+  selector: 'app-invoice-management-invoice-sales',
+  templateUrl: './invoice-sales.component.html',
+})
+export class InvoiceManagementInvoiceSalesComponent implements OnInit {
+  constructor(
+    private invoiceManagePurchaseService: InvoiceManagePurchaseService,
+    private nzDrawerService:NzDrawerService,
+    private i18NService:I18NService,
+    private nzNotificationService:NzNotificationService
+    ) {}
+
+  ngOnInit() {
+    this.getList()
+  }
+
+  listOfData = [];
+  invoiceManagePurchase: InvoiceManagePurchase = {}; //对象
+  page = {
+    total: 0,
+    current: 0,
+  }; //页码
+  isSpinning = false;
+
+  //按页码显示数据
+  pageIndexChange(event) {
+    this.invoiceManagePurchase.pageNo = event; //当前页码
+    this.getList();
+  }
+
+  /**
+   * 查询数据表
+   */
+  getList() {
+    this.isSpinning = true;
+    this.invoiceManagePurchase.pkOrg = sessionStorage.getItem('pkOrg'); //组织
+    this.invoiceManagePurchase.type = '2'; //销售发票
+    this.invoiceManagePurchaseService.getList(this.invoiceManagePurchase).then(response => {
+      this.listOfData = response.result.records;
+      this.isSpinning = false;
+    });
+  }
+
+  /**
+   * 新增按钮
+   */
+  add() {
+    const drawerRef = this.nzDrawerService.create<InvoiceManagementInvoiceSalesAddComponent, { quotationId: string }, string>({
+      nzTitle: this.i18NService.fanyi("button.add"),//新增标题
+      nzContent: InvoiceManagementInvoiceSalesAddComponent,
+      nzWidth: window.innerWidth,
+      nzBodyStyle: { height: 'calc(100% - 55px)', overflow: 'auto', 'padding-bottom': '53px' }
+      // nzContentParams: {
+      //   //模板id
+      //   quotationId: item.id
+      // }
+    });
+
+    //关闭抽屉的回调
+    drawerRef.afterClose.subscribe((isRefresh) => {
+      if (isRefresh) {//刷新list列表
+        this.getList();
+      }
+    });
+  }
+
+  /**
+   * 修改按钮
+   * @param data 修改对象
+   */
+  update(data) {
+    const drawerRef = this.nzDrawerService.create<InvoiceManagementInvoiceSalesUpdateComponent, { id: string }, string>({
+      nzTitle: this.i18NService.fanyi("table.update"),//新增标题
+      nzContent: InvoiceManagementInvoiceSalesUpdateComponent,
+      nzWidth: window.innerWidth,
+      nzBodyStyle: { height: 'calc(100% - 55px)', overflow: 'auto', 'padding-bottom': '53px' },
+      nzContentParams: {
+        //模板id
+        id: data.id
+      }
+    });
+
+    //关闭抽屉的回调
+    drawerRef.afterClose.subscribe((isRefresh) => {
+      if (isRefresh) {//刷新list列表
+        this.getList();
+      }
+    });
+  }
+
+  delete(id) {
+    let invoiceManagePurchase=new InvoiceManagePurchase();
+    invoiceManagePurchase.id=id;
+    this.invoiceManagePurchaseService.delete(invoiceManagePurchase).then((response)=>{
+      if (response.success) {
+        //删除成功
+        this.nzNotificationService.success(this.i18NService.fanyi('successful.deletion'), '');
+        this.getList();
+      } else {
+        //删除失败
+        this.nzNotificationService.error(this.i18NService.fanyi('delete.failed'), '');
+      }
+    })
+  }
+
+  /**
+   * 查询按钮
+   */
+  query() {
+    this.invoiceManagePurchase.pageNo = 1;
+    this.getList();
+  }
+}

+ 107 - 0
src/app/routes/invoice-management/invoice-sales/update/update.component.html

@@ -0,0 +1,107 @@
+<nz-spin [nzSpinning]="isLoadingSave">
+  <form nz-form [formGroup]="validateForm" (ngSubmit)="submitForm()">
+    <div nz-row [nzGutter]="24">
+      <div nz-col [nzSpan]="8">
+        <nz-form-item>
+          <nz-form-label [nzSm]="6" [nzXs]="24">单据编码</nz-form-label>
+          <nz-form-control [nzSm]="14" [nzXs]="24">
+            自动生成
+          </nz-form-control>
+        </nz-form-item>
+      </div>
+      <div nz-col [nzSpan]="8">
+        <nz-form-item>
+          <nz-form-label [nzSm]="6" [nzXs]="24">项目编码</nz-form-label>
+          <nz-form-control [nzSm]="14" [nzXs]="24">
+            {{invoiceManagePurchase.proCode}}
+          </nz-form-control>
+        </nz-form-item>
+      </div>
+      <div nz-col [nzSpan]="8">
+        <nz-form-item>
+          <nz-form-label [nzSm]="6" [nzXs]="24" nzRequired>项目名称</nz-form-label>
+          <nz-form-control [nzSm]="14" [nzXs]="24">
+            <nz-select style="widows: 100%;" nzShowSearch nzAllowClear formControlName="proArchivesId"
+              id="proArchivesId" [(ngModel)]="invoiceManagePurchase.proArchivesId" nzPlaceHolder="请选择"
+              (ngModelChange)="proChange($event)">
+              <nz-option *ngFor="let i of proList" [nzValue]="i.id" [nzLabel]="i.proName"></nz-option>
+            </nz-select>
+            <nz-form-explain
+              *ngIf="validateForm.get('proArchivesId')?.dirty && validateForm.get('proArchivesId')?.errors">
+              请选择项目名称
+            </nz-form-explain>
+          </nz-form-control>
+        </nz-form-item>
+      </div>
+    </div>
+  </form>
+
+
+<nz-card>
+  <div nz-row [nzGutter]="24">
+    <div nz-col [nzSpan]="24">
+      <!-- 新增按钮 -->
+      <button (click)="addRow()" nz-button nzType="primary">{{ 'button.add' | translate }}</button>
+    </div>
+  </div>
+  <div nz-row [nzGutter]="24">
+    <div nz-col [nzSpan]="24">
+      <nz-table style="padding-top: 5px;" nzSize="small" class="tableTdPadding" #basicTable
+        [nzData]="itemDataList" [nzFrontPagination]="false" [nzShowPagination]="false" >
+        <thead>
+          <tr>
+            <th nzAlign="center">序号</th>
+            <th>首付款条线</th>
+            <th>里程碑</th>
+            <th>金额</th>
+            <th>未收票金额</th>
+            <th>本次收票金额</th>
+            <th>操作</th>
+          </tr>
+        </thead>
+        <tbody>
+          <tr *ngFor="let data of basicTable.data;let i=index">
+            <td nzAlign="center">{{i+1}}</td>
+            <td style="width: 20%;">
+              <nz-select style="width: 100%;" nzShowSearch [(ngModel)]="data.coArchivesId" nzPlaceHolder="请选择" (ngModelChange)="coArchivesChange(data)">
+              <nz-option *ngFor="let i of coArchivesList" [nzValue]="i.id" [nzLabel]="i.planName" ></nz-option>
+            </nz-select>
+            </td>
+            <td style="width: 20%;">
+              <nz-select style="width: 100%;" nzShowSearch [(ngModel)]="data.proBusinessId" nzPlaceHolder="请选择"
+              (ngModelChange)="proBusinessIdChange(data)">
+              <nz-option *ngFor="let i of data.proBusinessList" [nzValue]="i.mileId" [nzLabel]="i.mileName"></nz-option>
+            </nz-select>
+            </td>
+            <td>
+              <!-- <nz-input-number [(ngModel)]="data.price" [nzMin]="0" [nzStep]="1" [nzFormatter]="formatterDollar" [nzParser]="parserDollar"></nz-input-number> -->
+              {{data.price}}
+            </td>
+            <td>
+              <!-- <nz-input-number [(ngModel)]="data.uncoPrice" [nzMin]="0" [nzStep]="1" [nzFormatter]="formatterDollar" [nzParser]="parserDollar"></nz-input-number> -->
+              {{data.uncoPrice}}
+            </td>
+            <td>
+              <nz-input-number [(ngModel)]="data.coPrice" [nzMax]="data.uncoPriceMax" [nzMin]="0" [nzStep]="1" [nzFormatter]="formatterDollar" [nzParser]="parserDollar" (ngModelChange)="coPriceKeyUp(data)"></nz-input-number>
+            </td>
+            <td ><a nz-popconfirm nzTitle="是否删除?"
+                (nzOnConfirm)="deleteRow(data.sort)">{{'table.delete'|translate}}</a></td>
+          </tr>
+        </tbody>
+      </nz-table>
+    </div>
+  </div>
+</nz-card>
+</nz-spin>
+<!-- 按钮 -->
+<div class="base">
+  <strong>填写人:</strong>{{invoiceManagePurchase.currentUser}} <strong>填写时间:</strong>{{invoiceManagePurchase.createTime}}
+  <!-- 关闭按钮 -->
+  <a nz-popconfirm nzTitle="{{'pm.contract.contract.add.button.cancel'|translate}}" (nzOnConfirm)="close()"
+    style="padding-right: 8px">
+    <button nz-button>{{'pm.quotation.cancel'|translate}}</button>
+  </a>
+  <!-- 保存按钮 -->
+  <button nz-button nzType="primary" class="ant-btn ant-btn-primary" (click)="submitForm()"
+    [nzLoading]="isLoadingSave"><span>{{'pm.finish' | translate}}</span></button>
+</div>

+ 24 - 0
src/app/routes/invoice-management/invoice-sales/update/update.component.spec.ts

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

+ 329 - 0
src/app/routes/invoice-management/invoice-sales/update/update.component.ts

@@ -0,0 +1,329 @@
+import { Component, OnInit } from '@angular/core';
+import { NzModalRef, NzMessageService, NzNotificationService, NzDrawerRef } from 'ng-zorro-antd';
+import { _HttpClient, SettingsService } from '@delon/theme';
+import { FormBuilder, Validators, FormGroup } from '@angular/forms';
+import { DatePipe } from '@angular/common';
+import { ProjectManageArchivesService } from 'app/services/project-manage-archives/project-manage-archives.service';
+import { BaseArchivesCollectionLineService } from 'app/services/basedata/base-archives-collection-line.service';
+import { InvoiceManagePurchaseService } from 'app/services/invoice-management/invoice-manage-purchase.service';
+import { I18NService } from '@core';
+import { InvoiceManagePurchase } from 'app/entity/invoice-management/invoice-manage-purchase';
+import { ProjectManageArchives } from 'app/entity/project-manage-archives/project-manage-archives';
+
+@Component({
+  selector: 'app-invoice-management-invoice-sales-update',
+  templateUrl: './update.component.html',
+  styles: [
+    `
+      .base {
+        position: absolute;
+        bottom: 0px;
+        width: 100%;
+        border-top: 1px solid rgb(232, 232, 232);
+        padding: 6px 16px;
+        text-align: right;
+        left: 0px;
+        background: #fff;
+        z-index: 99;
+      }
+    `,
+  ],
+})
+export class InvoiceManagementInvoiceSalesUpdateComponent implements OnInit {
+  constructor(
+    private fb: FormBuilder,
+    private settingsService: SettingsService,
+    private datePipe: DatePipe,
+    private projectManageArchivesService: ProjectManageArchivesService,
+    private baseArchivesCollectionLineService: BaseArchivesCollectionLineService,
+    private nzNotificationService: NzNotificationService,
+    private drawerRef: NzDrawerRef,
+    private invoiceManagePurchaseService: InvoiceManagePurchaseService,
+    private i18NService: I18NService,
+  ) {}
+
+  ngOnInit(): void {
+    //初始化表单
+    this.validateForm = this.fb.group({
+      proArchivesId: [null, [Validators.required]],
+    });
+
+    //项目下拉数据
+    this.isLoadingSave = true;
+
+    this.queryById()
+      .then(() => {
+        //根据id查询
+        return this.getProList();
+      })
+      .then(() => {
+        this.isLoadingSave = false;
+      });
+  }
+  validateForm!: FormGroup;
+  invoiceManagePurchase: InvoiceManagePurchase = {}; //对象
+  isLoadingSave = false;
+  proList = []; //项目下拉数据
+  itemDataList = []; //明细表格数据集合
+  coArchivesList = []; //条线档案数据集合
+  id = '';
+
+  queryById() {
+    return new Promise(resolve => {
+      this.invoiceManagePurchaseService.queryById(this.id).then(response => {
+        if (response.success) {
+          this.invoiceManagePurchase = response.result; //主表
+          this.itemDataList = response.result.detailList; //子表数据
+          //获取里程碑下拉数据
+          this.itemDataList.forEach(element => {
+            this.coArchivesChange(element);
+            //获取用来计算的未收票金额
+            element.uncoPriceMax = JSON.parse(JSON.stringify(element.uncoPrice));
+            //获取用来计算的第一次已开票金额
+            element.oneCoPrice = JSON.parse(JSON.stringify(element.coPrice));
+          });
+          if (this.itemDataList) {
+            //获取最大排序
+            this.sort = this.itemDataList.length + 1;
+          }
+          resolve();
+        } else {
+          resolve();
+        }
+      });
+    });
+  }
+
+  /**
+   * 获取项目下拉数据
+   */
+  getProList() {
+    return new Promise(resolve => {
+      let projectManageArchives = new ProjectManageArchives();
+      projectManageArchives.pageSize = 20000;
+      projectManageArchives.pkOrg = sessionStorage.getItem('pkOrg');
+      this.projectManageArchivesService.getList(projectManageArchives).then(response => {
+        if (response.result.records) {
+          this.proList = response.result.records;
+        }
+        resolve();
+      });
+    });
+  }
+
+  /**
+   * 获取条线下拉数据
+   */
+  // getCoArchivesList() {
+  //   return new Promise(resolve => {
+  //     let baseArchivesCollectionLine = new BaseArchivesCollectionLine();
+  //     baseArchivesCollectionLine.pageSize = 20000;
+  //     baseArchivesCollectionLine.pkOrg = sessionStorage.getItem('pkOrg');
+  //     this.baseArchivesCollectionLineService.getList(baseArchivesCollectionLine).then(response => {
+  //       if (response.result.records) {
+  //         this.coArchivesList = response.result.records;
+  //       }
+  //       resolve();
+  //     });
+  //   });
+  // }
+
+  /**
+   * 项目下拉选择事件
+   */
+  proChange(event) {
+    if (event) {
+      //根据id获取项目档案数据
+      this.projectManageArchivesService.getListById(event).then(response => {
+        if (response.success) {
+          let project = JSON.parse(JSON.stringify(response.result)); //项目档案对象
+          this.invoiceManagePurchase.proCode = project.proCode; //项目档案编码
+          this.invoiceManagePurchase.proName = project.proName; //项目档案名称
+          //获取首付款条线
+          this.getLineList();
+        }
+      });
+    }
+  }
+
+  //获取条线下拉数据
+  getLineList() {
+    //查询条件
+    let projectManageArchives = { proArchivesId: this.invoiceManagePurchase.proArchivesId, planType: '1' };
+    this.projectManageArchivesService.getLineList(projectManageArchives).then(response => {
+      if (response.success) {
+        this.coArchivesList = response.result;
+      }
+    });
+  }
+
+  /**
+   * 条线下拉选择事件
+   * 获取名称和里程碑下拉数据
+   */
+  coArchivesChange(data) {
+    if (data.coArchivesId) {
+      //获取条线名称
+      this.coArchivesList.forEach(element => {
+        if (data.coArchivesId === element.id) {
+          data.coArchivesName = element.planName;
+        }
+      });
+      //获取里程碑下拉数据
+      let where = { businessId: data.coArchivesId };
+      this.projectManageArchivesService.getMileNameById(where).then(response => {
+        if (response.success) {
+          data.proBusinessList = response.result;
+          //一般用于选择完里程碑又反过来选条线 则重新获取金额
+          if (data.proBusinessId) {
+            this.proBusinessChange(data);
+          }
+        }
+      });
+    }
+  }
+
+  /**
+   *
+   * 获取名称和金额
+   */
+  uncoPrice = 0; //未收票金额
+  proBusinessChange(data) {
+    if (data.proBusinessId) {
+      data.proBusinessList.forEach(element => {
+        if (element.mileId === data.proBusinessId) {
+          data.proArchivesMilestone = element.mileName; //名称
+          data.price = element.price; //金额
+        }
+      });
+    }
+  }
+
+  /**
+   * 里程碑选择事件
+   */
+  proBusinessIdChange(data) {
+    if (data.proBusinessId) {
+      this.proBusinessChange(data);
+      //查询条件
+      let where = { coArchivesId: data.coArchivesId, proBusinessId: data.proBusinessId };
+      //获取未开票金额
+      this.invoiceManagePurchaseService.getChildrenList(where).then(response => {
+        if (response.success) {
+          if (response.result.uncoPrice) {
+            data.uncoPrice = response.result.uncoPrice; //未收票金额
+            data.uncoPriceMax = Number(response.result.uncoPrice); //未收票金额
+          } else {
+            data.uncoPrice = JSON.parse(JSON.stringify(data.price)); //未收票金额
+            data.uncoPriceMax = Number(JSON.parse(JSON.stringify(data.price))); //未收票金额
+          }
+        }
+      });
+    }
+  }
+
+  /**
+   * 收票输入事件
+   */
+  coPriceKeyUp(data) {
+    if (data.coPrice) {
+      if (data.id) {
+        //未开票金额减(当前输入的减第一次已开票金额)
+        data.uncoPrice = data.uncoPriceMax - (Number(data.coPrice) - Number(data.oneCoPrice));
+      }else{
+        //未开票金额减已开票金额
+        data.uncoPrice=data.uncoPriceMax-Number(data.coPrice);
+      }
+    }
+  }
+
+  /**
+   * 增行按钮
+   */
+  sort = 0;
+  addRow() {
+    this.itemDataList = [
+      ...this.itemDataList,
+      {
+        price: '',
+        uncoPrice: '',
+        coPrice: '',
+        sort: this.sort,
+      },
+    ];
+    this.sort++;
+  }
+
+  /**
+   * 删除行
+   */
+  deleteRow(sort) {
+    this.itemDataList = this.itemDataList.filter(d => d.sort !== sort);
+  }
+
+  //金额格式化
+  formatterDollar = (value: number) => {
+    if (value) {
+      return `$ ${value}`;
+    } else {
+      return `$ `;
+    }
+  };
+  parserDollar = (value: string) => value.replace('$ ', '');
+
+  /**
+   * 提交保存按钮
+   */
+  submitForm(): any {
+    return new Promise(resolve => {
+      for (const i in this.validateForm.controls) {
+        this.validateForm.controls[i].markAsDirty();
+        this.validateForm.controls[i].updateValueAndValidity();
+      }
+      let valid = this.validateForm.valid;
+      if (valid) {
+        this.isLoadingSave = true;
+        this.invoiceManagePurchase.type = '2'; //销售
+        this.invoiceManagePurchase.pkOrg = sessionStorage.getItem('pkOrg');
+        //子表保存数据处理
+        if (this.itemDataList && this.itemDataList.length > 0) {
+          this.itemDataList.forEach(element => {
+            //获取条线名称
+            if (element.coArchivesId) {
+              this.coArchivesList.forEach(coArchives => {
+                if (coArchives.id == element.coArchivesId) {
+                  element.coArchivesName = coArchives.name;
+                }
+              });
+            } else {
+              element.coArchivesName = '';
+            }
+          });
+        } else {
+          //是否填写明细数据
+          this.nzNotificationService.warning('填写明细数据', '');
+          this.isLoadingSave = false;
+          return;
+        }
+        this.invoiceManagePurchase.detailList = this.itemDataList;
+        this.invoiceManagePurchaseService.update(this.invoiceManagePurchase).then(response => {
+          if (response.success) {
+            //保存成功
+            this.isLoadingSave = false;
+            this.nzNotificationService.success(this.i18NService.fanyi('save.ok'), '');
+            this.drawerRef.close(true);
+            resolve();
+          } else {
+            //保存失败
+            this.isLoadingSave = false;
+            this.nzNotificationService.error(this.i18NService.fanyi('save.not'), '');
+          }
+        });
+      }
+    });
+  }
+
+  close() {
+    this.drawerRef.close();
+  }
+}

+ 1 - 0
src/app/routes/project-manage-archives/add/add.component.ts

@@ -366,6 +366,7 @@ export class ProjectManageArchivesAddComponent implements OnInit {
         }
         element.muilesId = element.id;
         element.muilesName = element.name;
+        element.muilesCode = element.code;
         element.keyId = element.key;
         element.executor = names;
         element.executorId = ids;

+ 6 - 4
src/app/routes/project-manage-archives/add/development/development.component.html

@@ -76,10 +76,11 @@
         nzTableLayout="fixed" [nzShowPagination]="false" [nzFrontPagination]="false">
         <thead>
           <tr>
-            <th></th>
-            <th style="width: 10%;">里程碑</th>
-            <th style="width: 20%;">开始时间</th>
-            <th style="width: 20%;">结束时间</th>
+            <th style="width: 8%;" ></th>
+            <th style="width: 5%;">编码</th>
+            <th style="width: 12%;">里程碑</th>
+            <th style="width: 10%;">开始时间</th>
+            <th style="width: 10%;">结束时间</th>
             <th style="width: 10%;">计划人天</th>
             <th style="width: 20%;">执行人</th>
             <th style="width: 10%;">实际人天</th>
@@ -95,6 +96,7 @@
                 <td [nzIndentSize]="item.level! * 20" [nzShowExpand]="!!item.children" [(nzExpand)]="item.expand"
                   (nzExpandChange)="collapse(mapOfExpandedData[data.key], item, $event)">
                 </td>
+                <td><input nz-input [(ngModel)]="item.code" /></td>
                 <td>
                   <ng-container *ngIf="item.id">
                     {{ item.name }}

+ 1 - 0
src/app/routes/project-manage-archives/add/development/development.component.ts

@@ -172,6 +172,7 @@ export class ProjectManageArchivesAddDevelopmentComponent implements OnInit {
         mapData.forEach(el => {
           data.forEach(element => {
             if (element.key === el.key) {
+              el.code=element.code;
               el.name=element.name;
               el.muilesId = element.muilesId;
               el.muilesName = element.muilesName;

+ 8 - 5
src/app/routes/project-manage-archives/add/implementation/implementation.component.html

@@ -76,10 +76,11 @@
         nzTableLayout="fixed" [nzShowPagination]="false" [nzFrontPagination]="false">
         <thead>
           <tr>
-            <th nzAlign="center"></th>
-            <th style="width: 10%;">里程碑</th>
-            <th style="width: 20%;">开始时间</th>
-            <th style="width: 20%;">结束时间</th>
+            <th style="width: 8%;" ></th>
+            <th style="width: 5%;">编码</th>
+            <th style="width: 12%;">里程碑</th>
+            <th style="width: 10%;">开始时间</th>
+            <th style="width: 10%;">结束时间</th>
             <th style="width: 10%;">计划人天</th>
             <th style="width: 20%;">执行人</th>
             <th style="width: 10%;">实际人天</th>
@@ -93,8 +94,10 @@
 
               <tr *ngIf="(item.parent && item.parent.expand) || !item.parent">
                 <td [nzIndentSize]="item.level! * 20" [nzShowExpand]="!!item.children" [(nzExpand)]="item.expand"
-                  (nzExpandChange)="collapse(mapOfExpandedData[data.key], item, $event)">
+                  (nzExpandChange)="collapse(mapOfExpandedData[data.key], item, $event)">*
+                  <!-- <input style="width: 50%;" nz-input [(ngModel)]="item.code" /> -->
                 </td>
+                <td><input nz-input [(ngModel)]="item.code" /></td>
                 <td>
                   <ng-container *ngIf="item.id">
                     {{ item.name }}

+ 1 - 0
src/app/routes/project-manage-archives/add/implementation/implementation.component.ts

@@ -172,6 +172,7 @@ export class ProjectManageArchivesAddImplementationComponent implements OnInit {
         mapData.forEach(el => {
           data.forEach(element => {
             if (element.key === el.key) {
+              el.code=element.code;
               el.name=element.name;
               el.muilesId = element.muilesId;
               el.muilesName = element.muilesName;

+ 7 - 5
src/app/routes/project-manage-archives/add/serviceta/serviceta.component.html

@@ -76,10 +76,11 @@
         nzTableLayout="fixed" [nzShowPagination]="false" [nzFrontPagination]="false">
         <thead>
           <tr>
-            <th></th>
-            <th style="width: 10%;">里程碑</th>
-            <th style="width: 20%;">开始时间</th>
-            <th style="width: 20%;">结束时间</th>
+            <th style="width: 8%;" ></th>
+            <th style="width: 5%;">编码</th>
+            <th style="width: 12%;">里程碑</th>
+            <th style="width: 10%;">开始时间</th>
+            <th style="width: 10%;">结束时间</th>
             <th style="width: 10%;">计划人天</th>
             <th style="width: 20%;">执行人</th>
             <th style="width: 10%;">实际人天</th>
@@ -93,8 +94,9 @@
 
               <tr *ngIf="(item.parent && item.parent.expand) || !item.parent">
                 <td [nzIndentSize]="item.level! * 20" [nzShowExpand]="!!item.children" [(nzExpand)]="item.expand"
-                  (nzExpandChange)="collapse(mapOfExpandedData[data.key], item, $event)">
+                  (nzExpandChange)="collapse(mapOfExpandedData[data.key], item, $event)">*
                 </td>
+                <td><input nz-input [(ngModel)]="item.code" /></td>
                 <td>
                   <ng-container *ngIf="item.id">
                     {{ item.name }}

+ 1 - 0
src/app/routes/project-manage-archives/add/serviceta/serviceta.component.ts

@@ -157,6 +157,7 @@ export class ProjectManageArchivesAddServicetaComponent implements OnInit {
         mapData.forEach(el => {
           data.forEach(element => {
             if (element.key === el.key) {
+              el.code=element.code;
               el.name=element.name;
               el.muilesId = element.muilesId;
               el.muilesName = element.muilesName;

+ 7 - 5
src/app/routes/project-manage-archives/update/development/development.component.html

@@ -76,10 +76,11 @@
         nzTableLayout="fixed" [nzShowPagination]="false" [nzFrontPagination]="false">
         <thead>
           <tr>
-            <th></th>
-            <th style="width: 10%;">里程碑</th>
-            <th style="width: 20%;">开始时间</th>
-            <th style="width: 20%;">结束时间</th>
+            <th style="width: 8%;" ></th>
+            <th style="width: 5%;">编码</th>
+            <th style="width: 12%;">里程碑</th>
+            <th style="width: 10%;">开始时间</th>
+            <th style="width: 10%;">结束时间</th>
             <th style="width: 10%;">计划人天</th>
             <th style="width: 20%;">执行人</th>
             <th style="width: 10%;">实际人天</th>
@@ -93,8 +94,9 @@
 
               <tr *ngIf="(item.parent && item.parent.expand) || !item.parent">
                 <td [nzIndentSize]="item.level! * 20" [nzShowExpand]="!!item.children" [(nzExpand)]="item.expand"
-                  (nzExpandChange)="collapse(mapOfExpandedData[data.key], item, $event)">
+                  (nzExpandChange)="collapse(mapOfExpandedData[data.key], item, $event)">*
                 </td>
+                <td><input nz-input [(ngModel)]="item.muilesCode" /></td>
                 <td>
                   <ng-container *ngIf="item.muilesId">
                     {{ item.muilesName }}

+ 1 - 1
src/app/routes/project-manage-archives/update/essential-information/essential-information.component.html

@@ -71,7 +71,7 @@
         <nz-form-control [nzSm]="24" [nzXs]="24">
           <nz-select style="widows: 100%;" nzShowSearch nzAllowClear formControlName="milestoneId" id="milestoneId"
             [(ngModel)]="projectManageArchivesa.milestoneId" nzPlaceHolder="请选择"
-            (ngModelChange)="milestoneChange($event)">
+            (ngModelChange)="milestoneChange($event)" [nzDisabled]="true">
             <nz-option *ngFor="let i of milestoneList" [nzValue]="i.value" [nzLabel]="i.text"></nz-option>
           </nz-select>
           <nz-form-explain *ngIf="validateForm.get('milestoneId')?.dirty && validateForm.get('milestoneId')?.errors">

+ 8 - 6
src/app/routes/project-manage-archives/update/implementation/implementation.component.html

@@ -76,10 +76,11 @@
         nzTableLayout="fixed" [nzShowPagination]="false" [nzFrontPagination]="false">
         <thead>
           <tr>
-            <th nzAlign="center"></th>
-            <th style="width: 10%;">里程碑</th>
-            <th style="width: 20%;">开始时间</th>
-            <th style="width: 20%;">结束时间</th>
+            <th style="width: 8%;" ></th>
+            <th style="width: 5%;">编码</th>
+            <th style="width: 12%;">里程碑</th>
+            <th style="width: 10%;">开始时间</th>
+            <th style="width: 10%;">结束时间</th>
             <th style="width: 10%;">计划人天</th>
             <th style="width: 20%;">执行人</th>
             <th style="width: 10%;">实际人天</th>
@@ -93,8 +94,9 @@
 
               <tr *ngIf="(item.parent && item.parent.expand) || !item.parent">
                 <td [nzIndentSize]="item.level! * 20" [nzShowExpand]="!!item.children" [(nzExpand)]="item.expand"
-                  (nzExpandChange)="collapse(mapOfExpandedData[data.key], item, $event)">
+                  (nzExpandChange)="collapse(mapOfExpandedData[data.key], item, $event)">*
                 </td>
+                <td><input nz-input [(ngModel)]="item.muilesCode" /></td>
                 <td>
                   <ng-container *ngIf="item.muilesId">
                     {{ item.muilesName }}
@@ -104,7 +106,7 @@
                   </ng-container>
                 </td>
                 <td>
-                  <nz-date-picker [(ngModel)]="item.startDate"></nz-date-picker>
+                  <nz-date-picker [(ngModel)]="item.startDate" (ngModelChange)="startChange(item)"></nz-date-picker>
                 </td>
                 <td>
                   <nz-date-picker [(ngModel)]="item.endDate"></nz-date-picker>

+ 4 - 0
src/app/routes/project-manage-archives/update/implementation/implementation.component.ts

@@ -183,6 +183,10 @@ export class ProjectManageArchivesUpdateImplementationComponent implements OnIni
     });
   }
 
+  startChange(item){
+    console.log(item)
+  }
+
   ///////////////////////////树形配置
   mapOfExpandedData: { [key: string]: ProjectNodeTree[] } = {};
 

+ 7 - 6
src/app/routes/project-manage-archives/update/serviceta/serviceta.component.html

@@ -76,15 +76,15 @@
         nzTableLayout="fixed" [nzShowPagination]="false" [nzFrontPagination]="false">
         <thead>
           <tr>
-            <th></th>
-            <th style="width: 10%;">里程碑</th>
-            <th style="width: 20%;">开始时间</th>
-            <th style="width: 20%;">结束时间</th>
+            <th style="width: 8%;" ></th>
+            <th style="width: 5%;">编码</th>
+            <th style="width: 12%;">里程碑</th>
+            <th style="width: 10%;">开始时间</th>
+            <th style="width: 10%;">结束时间</th>
             <th style="width: 10%;">计划人天</th>
             <th style="width: 20%;">执行人</th>
             <th style="width: 10%;">实际人天</th>
             <th style="width: 10%;">操作</th>
-          </tr>
         </thead>
         <tbody>
           <ng-container *ngFor="let data of expandTable.data">
@@ -93,8 +93,9 @@
 
               <tr *ngIf="(item.parent && item.parent.expand) || !item.parent">
                 <td [nzIndentSize]="item.level! * 20" [nzShowExpand]="!!item.children" [(nzExpand)]="item.expand"
-                  (nzExpandChange)="collapse(mapOfExpandedData[data.key], item, $event)">
+                  (nzExpandChange)="collapse(mapOfExpandedData[data.key], item, $event)">*
                 </td>
+                <td><input nz-input [(ngModel)]="item.muilesCode" /></td>
                 <td>
                   <ng-container *ngIf="item.muilesId">
                     {{ item.muilesName }}

+ 1 - 1
src/app/routes/project-work/development-log/add/add.component.html

@@ -48,7 +48,7 @@
           </nz-form-control> -->
           <nz-form-control [nzSm]="14" [nzXs]="24">
             <nz-date-picker nzShowTime nzFormat="yyyy-MM-dd HH:mm:ss" formControlName="startDate" id="startDate"
-              [(ngModel)]="proWorkLogic.startDate" [nzDisabledDate]="disabledDate"></nz-date-picker>
+              [(ngModel)]="proWorkLogic.startDate" [nzDisabledDate]="disabledDate" ></nz-date-picker>
             <nz-form-explain *ngIf="validateForm.get('startDate')?.dirty && validateForm.get('startDate')?.errors">
               请选择开始时间
             </nz-form-explain>

+ 5 - 0
src/app/services/down-payment-management/manager-payment-and-receipt-slip.service.ts

@@ -33,4 +33,9 @@ export class ManagerPaymentAndReceiptSlipService {
   async delete(body:any):Promise<BaseResponse<any>>{
     return await this.http.delete<BaseResponse<any>>('payment/managerPaymentAndReceiptSlip/delete',{params:body}).toPromise();
   }
+
+  //修改
+  async update(body: ManagerPaymentAndReceiptSlip): Promise<BaseResponse<any>> {
+    return await this.http.put<BaseResponse<any>>('payment/managerPaymentAndReceiptSlip/edit', body).toPromise();
+  }
 }