货源修改

This commit is contained in:
wangshiming
2021-12-03 15:22:55 +08:00
parent a9ef21e333
commit db95de90fb
42 changed files with 2466 additions and 7 deletions

View File

@ -0,0 +1,10 @@
<nz-spin *ngIf="!orderObject" class="modal-spin"></nz-spin>
<div class="mb-md">编辑外部货源号</div>
<sf *ngIf="orderObject" #sf mode="edit" layout="horizontal" [schema]="schema" [ui]="ui" [formData]="orderObject"
button="none">
<div class="modal-footer">
<button nz-button type="button" (click)="close()">取消</button>
<button nz-button type="submit" nzType="primary" (click)="save(sf.value)" [disabled]="!sf.valid"
[nzLoading]="service.http.loading">确定</button>
</div>
</sf>

View File

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

View File

@ -0,0 +1,55 @@
import { Component, OnInit } from '@angular/core';
import { SFSchema, SFUISchema } from '@delon/form';
import { _HttpClient } from '@delon/theme';
import { NzMessageService } from 'ng-zorro-antd/message';
import { NzModalRef } from 'ng-zorro-antd/modal';
import { SupplyManagementService } from '../../services/supply-management.service';
@Component({
selector: 'app-supply-management-update-external-sn',
templateUrl: './update-external-sn.component.html',
})
export class SupplyManagementUpdateExternalSnComponent implements OnInit {
record: any = {};
orderObject: any;
schema: SFSchema = {
properties: {
owner: {
type: 'string',
maxLength: 30,
title: '',
ui: {
placeholder: '不超过30位'
}
},
},
required: ['owner'],
};
ui: SFUISchema = {
'*': {
spanControl: 24
},
};
constructor(
private modal: NzModalRef,
private msgSrv: NzMessageService,
public service: SupplyManagementService
) { }
ngOnInit(): void {
}
save(value: any): void {
const { id, sn } = value;
this.service.request(`/user/${this.record.id}`, { id, sn }).subscribe(res => {
this.msgSrv.success('保存成功');
this.modal.close(true);
});
}
close(): void {
this.modal.destroy();
}
}