车辆接口更新

This commit is contained in:
wangshiming
2022-01-20 16:08:16 +08:00
parent c6ebb6b0e6
commit 9232c4cc0e
8 changed files with 362 additions and 24 deletions

View File

@ -81,13 +81,13 @@ export class PaymentOrderDetailComponent implements OnInit {
hidden: true
}
},
feeHCode: {
type: 'string',
title: '费用单号',
ui: {
placeholder: '请输入'
}
},
// feeHCode: {
// type: 'string',
// title: '费用单号',
// ui: {
// placeholder: '请输入'
// }
// },
billHCode: {
type: 'string',
title: '订单号',
@ -102,26 +102,23 @@ export class PaymentOrderDetailComponent implements OnInit {
placeholder: '请输入'
}
},
feedate: {
title: '费用日期',
type: 'string',
ui: {
widget: 'sl-from-to-search',
format: 'yyyy-MM-dd',
visibleIf: {
expand: (value: boolean) => value
}
} as SFDateWidgetSchema
},
// feedate: {
// title: '费用日期',
// type: 'string',
// ui: {
// widget: 'sl-from-to-search',
// format: 'yyyy-MM-dd',
// visibleIf: {
// expand: (value: boolean) => value
// }
// } as SFDateWidgetSchema
// },
billTime: {
title: '订单日期',
type: 'string',
ui: {
widget: 'sl-from-to-search',
format: 'yyyy-MM-dd',
visibleIf: {
expand: (value: boolean) => value
}
} as SFDateWidgetSchema
},
cno: {

View File

@ -0,0 +1,80 @@
<!--
* @Description :
* @Version : 1.0
* @Author : Shiming
* @Date : 2022-01-19 10:47:46
* @LastEditors : Shiming
* @LastEditTime : 2022-01-20 15:52:07
* @FilePath : \\tms-obc-web\\src\\app\\routes\\sys-setting\\components\\announcement-message\\announcement-message.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
<page-header-wrapper title="公告信息管理"> </page-header-wrapper>
<nz-card>
<div nz-row nzGutter="8">
<!-- 查询字段小于或等于3个时不显示伸缩按钮 -->
<div nz-col nzSpan="24" *ngIf="queryFieldCount <= 4">
<sf
#sf
[schema]="schema"
[ui]="ui"
[mode]="'search'"
[loading]="service.http.loading"
(formSubmit)="st?.load(1)"
(formReset)="resetSF()"
></sf>
</div>
<!-- 查询字段大于3个时根据展开状态调整布局 -->
<ng-container *ngIf="queryFieldCount > 4">
<div nz-col [nzSpan]="_$expand ? 24 : 18">
<sf #sf [schema]="schema" [ui]="ui" [compact]="true" [button]="'none'"></sf>
</div>
<div nz-col [nzSpan]="_$expand ? 24 : 6" [class.expend-options]="_$expand" class="text-right">
<button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st?.load(1)">查询</button>
<button nz-button [disabled]="service.http.loading" nzType="primary">导出</button>
<button nz-button [disabled]="service.http.loading" (click)="resetSF()">重置</button>
<button nz-button nzType="link" (click)="expandToggle()">
{{ !_$expand ? '展开' : '收起' }}
<i nz-icon [nzType]="!_$expand ? 'down' : 'up'"></i>
</button>
</div>
</ng-container>
</div>
</nz-card>
<nz-card class="content-box">
<div class="d-flex justify-content-end mb-sm mt-sm">
<div>
<button nz-button nzType="primary" (click)="roleAction('', 1)">新增公告</button>
</div>
</div>
<st
#st
[data]="service.$api_getAnnouncementInfoList_page"
[columns]="columns"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams }"
[res]="{ reName: { list: 'data.records', total: 'data.total' } }"
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
[loading]="service.http.loading"
(change)="stChange($event)"
>
<ng-template st-row="customerType" let-item let-index="index">
<div>
<span *ngIf="item?.customerType == 1">客户</span>
<span *ngIf="item?.customerType == 2">供应商</span>
</div>
</ng-template>
</st>
</nz-card>
<nz-modal [(nzVisible)]="isVisible" [nzFooter]="nzModalFooter" [nzTitle]="editText" (nzOnOk)="handleOK()" (nzOnCancel)="handleCancel()">
<ng-container *nzModalContent>
<sf #sfFre [schema]="addSchema" [ui]="ui2" [formData]="formData" [compact]="false" [button]="'none'"> </sf>
</ng-container>
<ng-template #nzModalFooter>
<button nz-button nzType="primary" (click)="handleCancel()" [disabled]="">取消</button>
<button nz-button nzType="default" (click)="handleOK()">确 定</button>
</ng-template>
</nz-modal>

View File

@ -0,0 +1,13 @@
:host::ng-deep{
.search-box{
.ant-card-body{
padding-bottom: 18px;
}
}
.content-box{
.ant-card-body{
padding-top: 14px;
}
}
}

View File

@ -0,0 +1,226 @@
import { Component, OnInit, ViewChild, Type } from '@angular/core';
import { STComponent, STColumn, STChange } from '@delon/abc/st';
import { SFComponent, SFDateWidgetSchema, SFRadioWidgetSchema, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
import { ShipperBaseService } from '@shared';
import { NzModalService } from 'ng-zorro-antd/modal';
import { of } from 'rxjs';
import { map } from 'rxjs/operators';
import { SystemService } from '../../services/system.service';
@Component({
selector: 'app-sys-setting-components-announcement-message',
templateUrl: './announcement-message.component.html',
styleUrls: ['./announcement-message.component.less']
})
export class AnnouncementMessageComponent implements OnInit {
@ViewChild('st', { static: true })
st!: STComponent;
@ViewChild('sf', { static: false }) sf!: SFComponent;
@ViewChild('sfFre', { static: false }) sfFre!: SFComponent;
ui: SFUISchema = {};
ui2: SFUISchema = {};
schema: SFSchema = {};
addSchema: SFSchema = {};
_$expand = false;
editText = '';
formData :any;
isVisible = false;
edit = false;
editId = false;
columns: STColumn[] = [
{ title: '公告标题', index: 'announcementTitle' },
{ title: '创建时间', index: 'createTime' },
{ title: '发送时间', index: 'sendTime' },
{ title: '公告内容', index: 'announcementContent' },
{
title: '操作',
buttons: [
{
text: '编辑',
click: item => this.roleAction(item, 2)
},
{
text: '删除',
click: item => this.deleteAction(item)
},
]
}
];
selectedRows: any[] = [];
get reqParams (){
return {
...this.sf?.value,
createTime: {
start: this.sf?.value?.createTime?.[0] || '',
end: this.sf?.value?.createTime?.[1] || ''
}
}};
constructor(
public service: SystemService,
private nzModalService: NzModalService,
public shipperservice: ShipperBaseService,
) {}
ngOnInit(): void {
this.initSF()
this.initSFFre()
}
stChange(e: STChange): void {
switch (e.type) {
case 'checkbox':
this.selectedRows = e.checkbox!;
break;
case 'filter':
this.st.load();
break;
}
}
/**
* 伸缩查询条件
*/
expandToggle(): void {
this._$expand = !this._$expand;
this.sf?.setValue('/_$expand', this._$expand);
}
/**
* 查询字段个数
*/
get queryFieldCount(): number {
return Object.keys(this.schema?.properties || {}).length;
}
initSF(){
this.schema = {
properties: {
_$expand: { type: 'boolean', ui: { hidden: true } },
announcementTitle: {
type: 'string',
title: '按钮名称',
ui: { placeholder: '请输入' }
},
createTime: {
title: '创建时间',
type: 'string',
ui: {
widget: 'date',
mode: 'range',
format: 'yyyy-MM-dd',
allowClear: true,
} as SFDateWidgetSchema
},
}
};
this.ui = { '*': { spanLabelFixed: 110, grid: { span: 8, gutter: 4 } } };
}
initSFFre() {
this.addSchema = {
properties: {
appIdList: {
type: 'string',
title: '发布平台',
enum: [
{ label: '运营后台', value: 1 },
{ label: '货主后台', value: 2 },
{ label: '司机端', value: 3 }
],
ui: {
widget: 'select',
mode: 'multiple',
errors: { required: '请选择' },
placeholder: '请选择'
}
},
announcementTitle: {
type: 'string',
title: '公告标题',
ui: { placeholder: '请输入' }
},
announcementContent: {
type: 'string',
title: '公告内容',
ui: { placeholder: '请输入' }
},
sendTime: {
title: '发送时间',
type: 'string',
format: 'date-time',
ui: {
allowClear: true,
}
},
},
required: ['name', 'i18n', 'text']
};
this.ui2 = { '*': { spanLabelFixed: 120, grid: { span: 24 } } };
}
roleAction(value: any,item?: any) {
if(item === 1) {
this.edit = false;
this.editText = '新增';
this.formData = {};
} else {
this.service.request(this.service.$api_getButtonInfo_one, {id: value.id}).subscribe((res: any) => {
console.log(res)
if(res) {
this.formData = res;
}
})
this.edit = true;
this.editId = value.id;
this.editText = '编辑';
}
this.isVisible = true;
}
deleteAction(item?: any) {
this.nzModalService.error({
nzTitle: '确认删除?',
nzClosable: false,
nzCancelText: '取消',
nzOnOk: () => {
this.service.request(this.service.$api_settlementCustomer_deletebatch, [item.id]).subscribe(res => {
if (res) {
this.service.msgSrv.success('删除成功!');
this.st.reload(1)
}
})
}
});
}
/**
* 重置表单
*/
resetSF() {
this.sf.reset();
}
handleCancel() {
this.isVisible = false
}
handleOK() {
console.log(this.sfFre.value)
if(!this.sfFre.valid) {
this.service.msgSrv.warning('请正确填写完整!')
return
}
const params ={
...this.sfFre.value
}
if(this.editId) {
params.id = this.editId
}
this.service.request(this.service.$api_saveButtonInfo, params).subscribe((res:any) => {
if(res) {
this.service.msgSrv.success('保存成功!')
this.isVisible = false
this.st.reload();
}
})
}
}

View File

@ -1,7 +1,7 @@
/*
* @Author: your name
* @Date: 2021-12-20 17:18:43
* @LastEditTime : 2022-01-19 11:09:26
* @LastEditTime : 2022-01-20 15:46:46
* @LastEditors : Shiming
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath : \\tms-obc-web\\src\\app\\routes\\sys-setting\\services\\system.service.ts
@ -144,6 +144,20 @@ export class SystemService extends BaseService {
// 删除按钮信息(id)
$api_deletebatchButton = '/api/mdc/cuc/buttonInfo/deletebatchButton';
// 根据条件获取公告列表
$api_getAnnouncementInfoList_page = '/api/mdc/pbc/announcementInfo/getAnnouncementInfoList';
// 获取公告信息详情
$api_getAnnouncementInfoById_detail = '/api/mdc/pbc/announcementInfo/getAnnouncementInfoById';
// 删除公告信息
$api_delete_deleteAnnouncementInfoById = '/api/mdc/pbc/announcementInfo/deleteAnnouncementInfoById';
// 编辑公告信息
$api_modifyAnnouncementInfo = '/api/mdc/pbc/announcementInfo/modifyAnnouncementInfo';
// 新增公告信息
$api_addAnnouncementInfo = '/api/mdc/pbc/announcementInfo/addAnnouncementInfo';
$api_getRoleTemplateInfo: string = '';
$api_getFunctionButtonInfo: string = '';
$api_getFunctionDataInfo: string = '';

View File

@ -26,6 +26,7 @@ import { SystemSupplyLogsComponent } from './components/system-supply-logs/syste
import { SystemWaybillLogsComponent } from './components/system-waybill-logs/system-waybill-logs.component';
import { UserLogsComponent } from './components/user-logs/user-logs.component';
import { VersionLogsComponent } from './components/version-logs/version-logs.component';
import { AnnouncementMessageComponent } from './components/announcement-message/announcement-message.component';
const routes: Routes = [
{ path: 'staff-management', component: StaffManagementComponent },
@ -46,6 +47,7 @@ const routes: Routes = [
{ path: 'system-supply-logs', component: SystemSupplyLogsComponent },
{ path: 'system-waybill-logs', component: SystemWaybillLogsComponent },
{ path: 'btn-management', component: BtnManagementComponent },
{ path: 'announcement-message', component: AnnouncementMessageComponent },
];
@NgModule({

View File

@ -1,7 +1,7 @@
/*
* @Author: your name
* @Date: 2021-12-03 15:23:05
* @LastEditTime : 2022-01-19 10:53:26
* @LastEditTime : 2022-01-20 15:35:53
* @LastEditors : Shiming
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath : \\tms-obc-web\\src\\app\\routes\\sys-setting\\sys-setting.module.ts
@ -35,6 +35,7 @@ import { CloseAccountComponent } from './components/close-account/close-account.
import { SystemSupplyLogsComponent } from './components/system-supply-logs/system-supply-logs.component';
import { SystemWaybillLogsComponent } from './components/system-waybill-logs/system-waybill-logs.component';
import { BtnManagementComponent } from './components/btn-management/btn-management.component';
import { AnnouncementMessageComponent } from './components/announcement-message/announcement-message.component';
const COMPONENTS = [
StaffManagementComponent,
@ -54,7 +55,8 @@ const COMPONENTS = [
CloseAccountComponent,
SystemSupplyLogsComponent,
SystemWaybillLogsComponent,
BtnManagementComponent
BtnManagementComponent,
AnnouncementMessageComponent
];
const NOTROUTECOMPONENTS = [
BuyerTranspowerComponent,

View File

@ -484,6 +484,10 @@
"text": "按钮管理设置",
"link": "/system/btn-management"
},
{
"text": "公告信息管理",
"link": "/system/announcement-message"
},
{
"text": "车型车长配置",
"link": "/system/cart-config"