fix bug
This commit is contained in:
@ -57,12 +57,10 @@ export class SupplyManagementBulkComponent implements OnInit {
|
||||
* 查询参数
|
||||
*/
|
||||
get reqParams() {
|
||||
console.log(this.resourceStatus)
|
||||
const a:any = {};
|
||||
if(this.resourceStatus) {
|
||||
a.resourceStatus = this.resourceStatus
|
||||
}
|
||||
console.log(a)
|
||||
return {
|
||||
...a,
|
||||
...this.sf?.value,
|
||||
@ -366,6 +364,11 @@ export class SupplyManagementBulkComponent implements OnInit {
|
||||
},
|
||||
nzFooter: null,
|
||||
});
|
||||
modalRef.afterClose.subscribe(res => {
|
||||
if (res) {
|
||||
this.st.reload();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -1,17 +1,19 @@
|
||||
<!--
|
||||
* @Author: your name
|
||||
* @Date: 2021-12-03 11:10:14
|
||||
* @LastEditTime: 2021-12-07 19:50:54
|
||||
* @LastEditTime: 2021-12-10 15:14:11
|
||||
* @LastEditors: your name
|
||||
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
* @FilePath: \tms-obc-web\src\app\routes\supply-management\components\update-price\update-price.component.html
|
||||
-->
|
||||
<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>
|
||||
<sf *ngIf="i" #sf mode="edit" [schema]="schema" [ui]="ui" [formData]="ii" button="none">
|
||||
<ng-template sf-template="freightPrice" let-me let-ui="ui" let-schema="schema">
|
||||
<nz-input-group [nzAddOnAfter]="freightType[i?.freightType]">
|
||||
<input [max]="99999999" placeholder="请输入" type="number" [ngModel]="me.value"
|
||||
(ngModelChange)="me.setValue($event)" nz-input />
|
||||
</nz-input-group>
|
||||
</ng-template>
|
||||
<div class="modal-footer text-center">
|
||||
<button nz-button type="button" (click)="close()">取消</button>
|
||||
@ -23,10 +25,13 @@
|
||||
</div>
|
||||
<div>
|
||||
<h4>变更日志</h4>
|
||||
<!-- <st #st [data]="service.$api_get_catalogue_member" [bordered]="true" [columns]="columns" [page]="{show:false}">
|
||||
<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>
|
||||
</st>
|
||||
</div>
|
||||
<ng-template #addOnAfterTemplate>
|
||||
<span> {{freightType[i?.freightType]}}</span>
|
||||
</ng-template>
|
||||
|
||||
@ -1,11 +1,4 @@
|
||||
/*
|
||||
* @Author: your name
|
||||
* @Date: 2021-12-03 11:10:14
|
||||
* @LastEditTime: 2021-12-07 19:50:40
|
||||
* @LastEditors: your name
|
||||
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
* @FilePath: \tms-obc-web\src\app\routes\supply-management\components\update-price\update-price.component.ts
|
||||
*/
|
||||
import { Params } from '@angular/router';
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { STColumn } from '@delon/abc/st';
|
||||
import { SFComponent, SFSchema, SFUISchema } from '@delon/form';
|
||||
@ -21,60 +14,71 @@ import { SupplyManagementService } from '../../services/supply-management.servic
|
||||
export class SupplyManagementUpdatePriceComponent implements OnInit {
|
||||
record: any = {};
|
||||
i: any;
|
||||
ii: any;
|
||||
schema: SFSchema = {};
|
||||
ui: SFUISchema = {};
|
||||
columns: STColumn[] = [];
|
||||
@ViewChild('sf', { static: false }) sf!: SFComponent;
|
||||
freightType: any = {
|
||||
1: '元/吨',
|
||||
2: '元/方',
|
||||
3: '元/车'
|
||||
} // 运单类型
|
||||
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));
|
||||
console.log(this.i)
|
||||
const Params = {
|
||||
id: this.i.id
|
||||
}
|
||||
this.service.request(this.service.$api_get_listModifyPrice, Params).subscribe((res) =>{
|
||||
console.log(res)
|
||||
this.ii = res[0];
|
||||
})
|
||||
}
|
||||
|
||||
initSF() {
|
||||
this.schema = {
|
||||
properties: {
|
||||
no1: {
|
||||
resourceCode: {
|
||||
type: 'string',
|
||||
title: '货源编号',
|
||||
ui: {
|
||||
widget: 'text'
|
||||
},
|
||||
default: 0
|
||||
},
|
||||
description3: {
|
||||
freightPrice: {
|
||||
type: 'string',
|
||||
title: '运费单价',
|
||||
ui: {
|
||||
widget: 'custom'
|
||||
}
|
||||
},
|
||||
description1: {
|
||||
rule: {
|
||||
type: 'string',
|
||||
title: '取整规则',
|
||||
enum: [
|
||||
{ label: '保留小数', value: 0 },
|
||||
{ label: '抹除小数', value: 1 },
|
||||
{ label: '抹除个位', value: 2 },
|
||||
{ label: '保留小数', value: '1' },
|
||||
{ label: '抹除小数', value: '2' },
|
||||
{ label: '抹除个位', value: '3' },
|
||||
],
|
||||
default: 0,
|
||||
ui: {
|
||||
widget: 'select',
|
||||
optionalHelp: {
|
||||
text: '例如:付司机运费 = 重量*单价 = 999.99; 保留小数:即 999.99; 抹除小数:即 999.00; 抹除个位,即 990.00',
|
||||
text: '例如:付司机运费= 重量*单价 = 999.99;\n 保留小数:即 999.99; \n 抹除小数:即 999.00;\n 抹除个位,即 990.00',
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
required: ['owner', 'callNo', 'description1', 'description3'],
|
||||
required: ['freightPrice', 'rule',],
|
||||
};
|
||||
this.ui = {
|
||||
'*': {
|
||||
@ -95,9 +99,13 @@ export class SupplyManagementUpdatePriceComponent implements OnInit {
|
||||
];
|
||||
}
|
||||
save(value: any): void {
|
||||
this.service.request(`/user/${this.record.id}`, value).subscribe(res => {
|
||||
this.msgSrv.success('保存成功');
|
||||
this.modal.close(true);
|
||||
console.log(value)
|
||||
const { id, freightType, freightPrice, resourceCode, rule, resourceId } = value;
|
||||
this.service.request(this.service.$api_update_price, { id, freightType, freightPrice, resourceCode, rule, resourceId }).subscribe(res => {
|
||||
if (res) {
|
||||
this.msgSrv.success('保存成功');
|
||||
this.modal.close(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -55,12 +55,10 @@ export class SupplyManagementVehicleComponent implements OnInit {
|
||||
* 查询参数
|
||||
*/
|
||||
get reqParams() {
|
||||
console.log(this.resourceStatus)
|
||||
const a:any = {};
|
||||
if(this.resourceStatus) {
|
||||
a.resourceStatus = this.resourceStatus
|
||||
}
|
||||
console.log(a)
|
||||
return {
|
||||
...a,
|
||||
...this.sf?.value,
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* @Author: your name
|
||||
* @Date: 2021-12-03 11:10:14
|
||||
* @LastEditTime: 2021-12-09 21:13:41
|
||||
* @LastEditTime: 2021-12-10 15:03:10
|
||||
* @LastEditors: Please set LastEditors
|
||||
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
* @FilePath: \tms-obc-web\src\app\routes\supply-management\services\supply-management.service.ts
|
||||
@ -33,7 +33,9 @@ export class SupplyManagementService extends BaseService {
|
||||
$api_delete_Wholedeletebatch = `/api/sdc/unLoadingPlace/deletebatch`;
|
||||
// 删除货物信息
|
||||
$api_delete_bulkdeletebatch = `/api/sdc/goodsInfo/deletebatch`;
|
||||
|
||||
$api_get_catalogue_member = `/user?_allow_anonymous=true`;
|
||||
$api_get_listModifyPrice = `/api/sdc/goodsInfo/listModifyPrice`;
|
||||
$api_update_price = `/api/sdc/goodsInfo/modifyPrice`; // 根据货物ID修改单价
|
||||
constructor(public injector: Injector) {
|
||||
super(injector)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user