解决冲突

This commit is contained in:
wangshiming
2022-02-24 20:04:18 +08:00
parent 36166726ed
commit 2107de50d7
5 changed files with 81 additions and 23 deletions

View File

@ -4,7 +4,7 @@
* @Author : Shiming * @Author : Shiming
* @Date : 2022-01-05 11:01:55 * @Date : 2022-01-05 11:01:55
* @LastEditors : Shiming * @LastEditors : Shiming
* @LastEditTime : 2022-02-24 10:23:53 * @LastEditTime : 2022-02-24 20:01:39
* @FilePath : \\tms-obc-web\\src\\app\\routes\\contract-management\\components\\contract-template-detail\\contract-template-detail.component.ts * @FilePath : \\tms-obc-web\\src\\app\\routes\\contract-management\\components\\contract-template-detail\\contract-template-detail.component.ts
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
*/ */
@ -12,6 +12,7 @@ import { DatePipe } from '@angular/common';
import { Component, OnInit, ViewChild } from '@angular/core'; import { Component, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { SFComponent, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form'; import { SFComponent, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
import { ShipperBaseService } from '@shared';
import { NzModalService } from 'ng-zorro-antd/modal'; import { NzModalService } from 'ng-zorro-antd/modal';
import { ContractManagementService } from '../../services/contract-management.service'; import { ContractManagementService } from '../../services/contract-management.service';
@ -27,7 +28,8 @@ export class ContractManagementTemplateTextComponent implements OnInit {
public service: ContractManagementService, public service: ContractManagementService,
public route: ActivatedRoute, public route: ActivatedRoute,
private datePipe: DatePipe, private datePipe: DatePipe,
private router: Router private router: Router,
public shipperservice: ShipperBaseService,
) {} ) {}
textStatus = '新建模板'; textStatus = '新建模板';
@ViewChild('sf', { static: false }) sf!: SFComponent; @ViewChild('sf', { static: false }) sf!: SFComponent;
@ -84,19 +86,68 @@ export class ContractManagementTemplateTextComponent implements OnInit {
} }
} as SFSelectWidgetSchema } as SFSelectWidgetSchema
}, },
// contractType: {
// title: '单据类型',
// type: 'string',
// default: '',
// ui: {
// widget: 'dict-select',
// params: { dictKey: 'contract:document:type' },
// containAllLable: true,
// visibleIf: {
// templateType: value => value === 'MX'
// }
// } as SFSelectWidgetSchema
// },
signingObject: {
type: 'string',
title: '承包商对象',
enum: [
{ label: '货主', value: 1 },
{ label: '司机', value: 2 }
],
ui: {
widget: 'select',
placeholder: '请选择'
}
},
contractType: { contractType: {
title: '单据类型', title: '合同类型',
type: 'string', type: 'string',
default: '', default: '',
ui: { ui: {
widget: 'dict-select', widget: 'dict-select',
params: { dictKey: 'contract:document:type' }, containsAllLable: true,
params: { dictKey: 'contract:type' },
containAllLable: true, containAllLable: true,
} as SFSelectWidgetSchema
},
resourceType: {
title: '货源类型',
type: 'string',
default: '',
ui: {
widget: 'dict-select',
params: { dictKey: 'contract:template:type' },
containsAllLable: true,
visibleIf: { visibleIf: {
templateType: value => value === 'MX' templateType: value => value === 'MX'
} }
} as SFSelectWidgetSchema } as SFSelectWidgetSchema,
} },
enterpriseInfoId: {
type: 'string',
title: '网络货运人',
ui: {
widget: 'select',
placeholder: '请选择',
allowClear: true,
visibleIf: {
templateType: value => value === 'KJ' || value === 'HHR'
},
asyncData: () => this.shipperservice.getNetworkFreightForwarder()
}
},
}, },
required: ['templateName', 'templateType'] required: ['templateName', 'templateType']
}; };
@ -126,6 +177,8 @@ export class ContractManagementTemplateTextComponent implements OnInit {
}; };
} }
initData(url: string) { initData(url: string) {
console.log('编辑');
this.service.request(url, { id: this.route.snapshot.params.id }).subscribe(res => { this.service.request(url, { id: this.route.snapshot.params.id }).subscribe(res => {
if (res) { if (res) {
this.detailList = res; this.detailList = res;
@ -140,21 +193,22 @@ export class ContractManagementTemplateTextComponent implements OnInit {
} }
save() { save() {
if (!this.sf.value.templateName || !this.sf.value.templateType || !this.sf2.value.templateContent || !this.title) { // if (!this.sf.value.templateName || !this.sf.value.templateType || !this.sf2.value.templateContent || !this.title) {
this.service.msgSrv.error('必填参数为空,请检查再重新保存!'); // this.service.msgSrv.error('必填参数为空,请检查再重新保存!');
return; // return;
} // }
if (this.sf.value.templateType == 'MX') { // if (this.sf.value.templateType == 'MX') {
if (this.sf.value.contractType == '') { // if (this.sf.value.contractType == '') {
this.service.msgSrv.error('必填参数为空,请检查再重新保存!'); // this.service.msgSrv.error('必填参数为空,请检查再重新保存!');
return; // return;
} // }
} // }
const params = { const params = {
...this.sf.value, ...this.sf.value,
...this.sf2.value, ...this.sf2.value,
templateTitle: this.title templateTitle: this.title || this.detailList.templateName
}; };
console.log(params)
this.service.request(this.service.$api_save_contractTemplate, params).subscribe((res: any) => { this.service.request(this.service.$api_save_contractTemplate, params).subscribe((res: any) => {
if (res) { if (res) {
this.service.msgSrv.success('保存成功!'); this.service.msgSrv.success('保存成功!');

View File

@ -4,8 +4,8 @@
* @Author : Shiming * @Author : Shiming
* @Date : 2022-01-12 10:52:50 * @Date : 2022-01-12 10:52:50
* @LastEditors : Shiming * @LastEditors : Shiming
* @LastEditTime : 2022-02-24 10:31:05 * @LastEditTime : 2022-02-24 20:01:42
* @FilePath : \\tms-obc-web\\src\\app\\routes\\contract-management\\components\\contract-template\\contract-template.component.html * @FilePath : \\tms-obc-web\\src\\app\\routes\\contract-management\\components\\contract-template-frame\\contract-template-frame.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
--> -->
@ -77,6 +77,10 @@
<ng-template st-row="templateName" let-item let-index="index"> <ng-template st-row="templateName" let-item let-index="index">
<a (click)="view(item)">{{ item.templateName }}</a> <a (click)="view(item)">{{ item.templateName }}</a>
</ng-template> </ng-template>
<ng-template st-row="signingObject" let-item let-index="index">
<span *ngIf="item?.signingObject == 1">货主</span>
<span *ngIf="item?.signingObject == 2">司机</span>
</ng-template>
</st> </st>
</div> </div>
</nz-card> </nz-card>

View File

@ -131,7 +131,7 @@ export class ContractManagementTemplateFrameComponent implements OnInit {
title: '签约对象', title: '签约对象',
width: '100px', width: '100px',
className: 'text-center', className: 'text-center',
index: 'signingObject' render: 'signingObject'
}, },
{ {
title: '合同类型', title: '合同类型',

View File

@ -49,7 +49,7 @@ export class ContractManagementTemplatePartnerComponent implements OnInit {
*/ */
get reqParams() { get reqParams() {
return { return {
templateType: 'MX', templateType: 'HHR',
...this.sf?.value, ...this.sf?.value,
}; };
} }

View File

@ -4,7 +4,7 @@
* @Author : Shiming * @Author : Shiming
* @Date : 2022-01-12 10:52:50 * @Date : 2022-01-12 10:52:50
* @LastEditors : Shiming * @LastEditors : Shiming
* @LastEditTime : 2022-02-17 11:13:43 * @LastEditTime : 2022-02-24 20:03:23
* @FilePath : \\tms-obc-web\\src\\app\\routes\\insurance-management\\components\\list\\list.component.html * @FilePath : \\tms-obc-web\\src\\app\\routes\\insurance-management\\components\\list\\list.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
--> -->
@ -84,7 +84,7 @@
</ng-template> </ng-template>
<ng-template st-row="distance" let-item let-index="index"> <ng-template st-row="distance" let-item let-index="index">
<div> <div>
{{ item?.distance ? item?.distance + '公里' : '' }} {{ item?.distance ? ((item?.distance)/1000).toFixed(4) + '公里' : '' }}
</div> </div>
</ng-template> </ng-template>
<ng-template st-row="goodsNumber" let-item let-index="index"> <ng-template st-row="goodsNumber" let-item let-index="index">