车辆对接

This commit is contained in:
wangshiming
2021-12-28 17:23:31 +08:00
parent 34efb8be23
commit 1587602f7e
4 changed files with 46 additions and 41 deletions

View File

@ -1,14 +1,6 @@
<!--
* @Author: your name
* @Date: 2021-12-03 11:10:14
* @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]="ii" button="none">
<sf *ngIf="i" #sf mode="edit" [schema]="schema" [ui]="ui" [formData]="i" 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"

View File

@ -1,4 +1,3 @@
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';
@ -14,7 +13,6 @@ import { SupplyManagementService } from '../../services/supply-management.servic
export class SupplyManagementUpdatePriceComponent implements OnInit {
record: any = {};
i: any;
ii: any;
schema: SFSchema = {};
ui: SFUISchema = {};
columns: STColumn[] = [];
@ -34,14 +32,7 @@ export class SupplyManagementUpdatePriceComponent implements OnInit {
ngOnInit(): void {
this.initSF();
this.initSt();
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];
})
if (this.record?.id) this.getGoodsResourceShipperDeatail(this.record?.id);
}
initSF() {
@ -64,13 +55,10 @@ export class SupplyManagementUpdatePriceComponent implements OnInit {
rule: {
type: 'string',
title: '取整规则',
enum: [
{ label: '保留小数', value: '1' },
{ label: '抹除小数', value: '2' },
{ label: '抹除个位', value: '3' },
],
default: '0',
ui: {
widget: 'select',
widget: 'dict-select',
params: { dictKey: 'goodresource:rounding:rules' },
optionalHelp: {
text: '例如:付司机运费= 重量*单价 = 999.99;\n 保留小数:即 999.99; \n 抹除小数:即 999.00;\n 抹除个位,即 990.00',
}
@ -88,6 +76,13 @@ export class SupplyManagementUpdatePriceComponent implements OnInit {
};
}
getGoodsResourceShipperDeatail(id: any) {
this.service.request(this.service.$api_get_goods_resource_shipper, { id }).subscribe(res => {
if (res) {
this.i = res;
}
})
}
/**
* 初始化数据列表
*/
@ -99,8 +94,9 @@ export class SupplyManagementUpdatePriceComponent implements OnInit {
];
}
save(value: any): void {
console.log(value)
const { id, freightType, freightPrice, resourceCode, rule, resourceId } = value;
console.log(value);
// const { id: resourceId, freightType, freightPrice, resourceCode, rule, goodsID: id } = value;
const { resourceId, freightType, freightPrice, resourceCode, rule, id } = value;
this.service.request(this.service.$api_update_price, { id, freightType, freightPrice, resourceCode, rule, resourceId }).subscribe(res => {
if (res) {
this.msgSrv.success('保存成功');