fix bug
This commit is contained in:
@ -2,7 +2,7 @@ import { preloaderFinished } from '@delon/theme';
|
||||
/*
|
||||
* @Author: your name
|
||||
* @Date: 2021-12-14 14:03:07
|
||||
* @LastEditTime: 2021-12-14 15:16:27
|
||||
* @LastEditTime: 2021-12-15 15:52:36
|
||||
* @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\order-management\modal\bulk\update-freight\update-freight.component.ts
|
||||
@ -23,11 +23,11 @@ import { NzMessageService } from 'ng-zorro-antd/message';
|
||||
import { NzModalRef } from 'ng-zorro-antd/modal';
|
||||
|
||||
@Component({
|
||||
selector: 'app-order-management-update-freight',
|
||||
selector: 'app-order-management-vehicle-update-freight',
|
||||
templateUrl: './update-freight.component.html',
|
||||
styleUrls: ['./update-freight.component.less']
|
||||
})
|
||||
export class UpdateFreightComponent implements OnInit {
|
||||
export class VehicleUpdateFreightComponent implements OnInit {
|
||||
record: any = {};
|
||||
i: any;
|
||||
@ViewChild('sf', { static: false }) sf!: SFComponent;
|
||||
@ -41,88 +41,49 @@ export class UpdateFreightComponent implements OnInit {
|
||||
|
||||
if (this.record.id > 0) this.http.get(`/user/${this.record.id}`).subscribe(res => (this.i = res));
|
||||
}
|
||||
// 运输费
|
||||
get transportation () {
|
||||
console.log(this.sf?.value)
|
||||
const value = Number(this.sf?.value?.number || 0) + Number(this.sf?.value?.number2 || 0) + Number(this.sf?.value?.number3 || 0)
|
||||
console.log( value )
|
||||
return value || 0
|
||||
}
|
||||
// 总运费
|
||||
get gross () {
|
||||
const value = Number(this.transportation || 0) + Number(this.transportation || 0)
|
||||
console.log( value )
|
||||
return value || 0
|
||||
}
|
||||
// 附加费
|
||||
get additional () {
|
||||
return 100
|
||||
}
|
||||
initSF() {
|
||||
this.schema= {
|
||||
properties: {
|
||||
no: {
|
||||
type: 'string',
|
||||
title: '运费单价',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
}
|
||||
},
|
||||
sex: {
|
||||
title: '',
|
||||
type: 'string',
|
||||
enum: [
|
||||
{ label: '保留小数', value: 0 },
|
||||
{ label: '男', value: 1 },
|
||||
{ label: '女', value: 2 },
|
||||
{ label: '保密', value: 3 },
|
||||
],
|
||||
ui: {
|
||||
widget: 'select',
|
||||
} as SFSelectWidgetSchema,
|
||||
},
|
||||
appId: {
|
||||
type: 'string',
|
||||
title: '结算依据',
|
||||
ui: {
|
||||
width: 300,
|
||||
grid: { span: 24 },
|
||||
widget: 'select',
|
||||
placeholder: '请选择',
|
||||
allowClear: true,
|
||||
// asyncData: () => this.getCatalogueMember(),
|
||||
},
|
||||
},
|
||||
no2: {
|
||||
type: 'string',
|
||||
title: '装货重量',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
}
|
||||
},
|
||||
no3: {
|
||||
type: 'string',
|
||||
title: '装货体积',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
}
|
||||
},
|
||||
no4: {
|
||||
type: 'string',
|
||||
title: '卸货重量',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
}
|
||||
},
|
||||
no5: {
|
||||
type: 'string',
|
||||
title: '卸货体积',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
}
|
||||
},
|
||||
number: { type: 'number',title: '预付' ,minimum: 1, maximum: 999999999, multipleOf: 1, ui: { widgetWidth: 200 } },
|
||||
number2: { type: 'number',title: '到付' ,minimum: 1, maximum: 999999999, multipleOf: 1, ui: { widgetWidth: 200 } },
|
||||
number3: { type: 'number',title: '回单付' ,minimum: 1, maximum: 999999999, multipleOf: 1, ui: { widgetWidth: 200 } },
|
||||
name3: {
|
||||
type: 'string',
|
||||
title: '变更原因',
|
||||
maxLength: 100,
|
||||
ui: {
|
||||
width: 300,
|
||||
widgetWidth: 300,
|
||||
placeholder:"选填,最多不超过100字",
|
||||
widget: 'textarea',
|
||||
autosize: { minRows: 3, maxRows: 6 }
|
||||
} as SFTextareaWidgetSchema
|
||||
},
|
||||
},
|
||||
required: ['no', 'appId'],
|
||||
required: ['name3'],
|
||||
type: 'object',
|
||||
};
|
||||
this.ui = { '*': { spanLabelFixed: 100, grid: { span: 12, gutter: 4 } }
|
||||
this.ui = { '*': { spanLabelFixed: 100, grid: { span: 16,gutter:8 } }
|
||||
};
|
||||
}
|
||||
save(value: any): void {
|
||||
console.log(this.sf.value)
|
||||
console.log(value)
|
||||
console.log(this.data)
|
||||
this.http.post(`/user/${this.record.id}`, value).subscribe(res => {
|
||||
|
||||
Reference in New Issue
Block a user