货源修改
This commit is contained in:
@ -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>
|
||||
@ -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();
|
||||
});
|
||||
});
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user