货源修改
This commit is contained in:
@ -0,0 +1,24 @@
|
||||
<div class="mb-lg">
|
||||
<nz-spin *ngIf="!i" class="modal-spin"></nz-spin>
|
||||
<sf *ngIf="i" #sf mode="edit" [schema]="schema" [ui]="ui" [formData]="i" button="none">
|
||||
<ng-template sf-template="description3" let-me let-ui="ui" let-schema="schema">
|
||||
<input [max]="99999999" placeholder="请输入" type="number" [ngModel]="me.value" style="width: 200px;" nz-input />
|
||||
<span> 元/吨</span>
|
||||
</ng-template>
|
||||
<div class="modal-footer text-center">
|
||||
<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>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
<h4>变更日志</h4>
|
||||
<st #st [data]="service.$api_get_catalogue_member" [bordered]="true" [columns]="columns" [page]="{show:false}">
|
||||
<ng-template st-row="operator" let-item let-index="index">
|
||||
<div>黎日湛</div>
|
||||
<div>18811112222</div>
|
||||
</ng-template>
|
||||
</st>
|
||||
</div>
|
||||
@ -0,0 +1,24 @@
|
||||
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { SupplyManagementUpdatePriceComponent } from './update-price.component';
|
||||
|
||||
describe('SupplyManagementUpdatePriceComponent', () => {
|
||||
let component: SupplyManagementUpdatePriceComponent;
|
||||
let fixture: ComponentFixture<SupplyManagementUpdatePriceComponent>;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ SupplyManagementUpdatePriceComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(SupplyManagementUpdatePriceComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -0,0 +1,99 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { STColumn } from '@delon/abc/st';
|
||||
import { SFComponent, 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-price',
|
||||
templateUrl: './update-price.component.html',
|
||||
})
|
||||
export class SupplyManagementUpdatePriceComponent implements OnInit {
|
||||
record: any = {};
|
||||
i: any;
|
||||
schema: SFSchema = {};
|
||||
ui: SFUISchema = {};
|
||||
columns: STColumn[] = [];
|
||||
@ViewChild('sf', { static: false }) sf!: SFComponent;
|
||||
constructor(
|
||||
private modal: NzModalRef,
|
||||
private msgSrv: NzMessageService,
|
||||
public service: SupplyManagementService
|
||||
) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
this.initSF();
|
||||
this.initSt();
|
||||
if (this.record.id > 0)
|
||||
this.service.request(`/user/${this.record.id}`).subscribe(res => (this.i = res));
|
||||
}
|
||||
|
||||
initSF() {
|
||||
this.schema = {
|
||||
properties: {
|
||||
no1: {
|
||||
type: 'string',
|
||||
title: '货源编号',
|
||||
ui: {
|
||||
widget: 'text'
|
||||
},
|
||||
default: 0
|
||||
},
|
||||
description3: {
|
||||
type: 'string',
|
||||
title: '运费单价',
|
||||
ui: {
|
||||
widget: 'custom'
|
||||
}
|
||||
},
|
||||
description1: {
|
||||
type: 'string',
|
||||
title: '取整规则',
|
||||
enum: [
|
||||
{ label: '保留小数', value: 0 },
|
||||
{ label: '抹除小数', value: 1 },
|
||||
{ label: '抹除个位', value: 2 },
|
||||
],
|
||||
default: 0,
|
||||
ui: {
|
||||
widget: 'select',
|
||||
optionalHelp: {
|
||||
text: '例如:付司机运费 = 重量*单价 = 999.99; 保留小数:即 999.99; 抹除小数:即 999.00; 抹除个位,即 990.00',
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
required: ['owner', 'callNo', 'description1', 'description3'],
|
||||
};
|
||||
this.ui = {
|
||||
'*': {
|
||||
spanLabelFixed: 100,
|
||||
grid: { span: 16 },
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化数据列表
|
||||
*/
|
||||
initSt() {
|
||||
this.columns = [
|
||||
{ title: '日志内容', width: 120, index: 'owner', className: 'text-center' },
|
||||
{ title: '更新时间', index: 'goodsQuantity', width: 100, className: 'text-center' },
|
||||
{ title: '操作人', width: 100, render: 'operator', className: 'text-center' },
|
||||
];
|
||||
}
|
||||
save(value: any): void {
|
||||
this.service.request(`/user/${this.record.id}`, value).subscribe(res => {
|
||||
this.msgSrv.success('保存成功');
|
||||
this.modal.close(true);
|
||||
});
|
||||
}
|
||||
|
||||
close(): void {
|
||||
this.modal.destroy();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user