fix style
This commit is contained in:
@ -1,59 +0,0 @@
|
||||
<button nz-button nzType="primary" style="margin-bottom: 24px" (click)="add()"><i nz-icon
|
||||
nzType="plus"></i>添加司机</button>
|
||||
<!-- 搜索区 -->
|
||||
<div nz-row nzGutter="8">
|
||||
<div nz-col [nzSpan]="12">
|
||||
<div nz-row nzGutter="8">
|
||||
<div nz-col [nzSpan]="18">
|
||||
<sf #sf [ui]="ui" [schema]="schema" [button]="'none'"></sf>
|
||||
</div>
|
||||
<div nz-col [nzSpan]="6">
|
||||
<button nz-button nzType="primary" [nzLoading]="service.http.loading" (click)="st.load(1)">查询</button>
|
||||
<button nz-button (click)="resetSF()">重置</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div nz-row nzGutter="8">
|
||||
<div nz-col [nzSpan]="14">
|
||||
<!-- 数据列表 -->
|
||||
<st #st [bordered]="true" [data]="service.$api_get_practice_car_list" [columns]="columns" size="small"
|
||||
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams,lazyLoad:true }"
|
||||
[res]="{ reName: { list: 'data.records', total: 'data.total' } , process: resProcess}"
|
||||
[page]="{ show: true, showSize: true, pageSizes: [10, 20, 30, 50, 100, 200, 300, 500, 1000] }"
|
||||
[loading]="service.http.loading" [widthMode]="{ type: 'strict' }" [scroll]="{ x: '600px' }"
|
||||
style="margin-top: 22px;" (change)="changeSt($event)">
|
||||
<ng-template st-row="userCarLicenseDesensitizationVOList" let-item let-index="index">
|
||||
<nz-select [(ngModel)]="item.default" (ngModelChange)="carChange($event, item)" style="width: 100%;">
|
||||
<nz-option nzValue="" nzLabel="不限"></nz-option>
|
||||
<nz-option [nzValue]="cart" [nzLabel]="cart.carNo"
|
||||
*ngFor="let cart of item.userCarLicenseDesensitizationVOList">
|
||||
</nz-option>
|
||||
</nz-select>
|
||||
</ng-template>
|
||||
|
||||
|
||||
</st>
|
||||
</div>
|
||||
<div nz-col [nzSpan]="10">
|
||||
<!-- 选中列表 -->
|
||||
<div>已选择{{ st2Data.length }}位司机</div>
|
||||
<st #st2 [bordered]="true" [data]="st2Data" [columns]="columns2" size="small"
|
||||
[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] }"
|
||||
[loadingDelay]="500" [loading]="service.http.loading" [widthMode]="{ type: 'strict' }">
|
||||
<ng-template st-row="carNo" let-item let-index="index">
|
||||
<span>{{ item.carNo ? item.carNo:'不限' }}</span>
|
||||
</ng-template>
|
||||
<ng-template st-row="captain" let-item let-index="index">
|
||||
<span>{{ item.captainName }} {{ item.captainPhone }}</span>
|
||||
<a (click)="setCaptain(item)">设置</a>
|
||||
</ng-template>
|
||||
</st>
|
||||
</div>
|
||||
</div>
|
||||
<div *nzModalFooter>
|
||||
<button nz-button nzType="default" (click)="cancel()">取消</button>
|
||||
<button nz-button nzType="primary" (click)="submit()">发布并指派给司机</button>
|
||||
</div>
|
||||
@ -1,24 +0,0 @@
|
||||
import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { SupplyManagementBulkAssignedCarComponent } from './assigned-car-bulk.component';
|
||||
|
||||
describe('SupplyManagementBulkAssignedCarComponent', () => {
|
||||
let component: SupplyManagementBulkAssignedCarComponent;
|
||||
let fixture: ComponentFixture<SupplyManagementBulkAssignedCarComponent>;
|
||||
|
||||
beforeEach(waitForAsync(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [SupplyManagementBulkAssignedCarComponent]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(SupplyManagementBulkAssignedCarComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@ -1,292 +0,0 @@
|
||||
import { Component, Input, OnInit, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { STChange, STColumn, STColumnBadge, STComponent, STData } from '@delon/abc/st';
|
||||
import { SFComponent, SFSchema, SFUISchema } from '@delon/form';
|
||||
import { ModalHelper } from '@delon/theme';
|
||||
import { isTemplateRef } from 'ng-zorro-antd/core/util';
|
||||
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { SupplyManagementService } from '../../services/supply-management.service';
|
||||
import { SupplyManagementAddDriversComponent } from '../add-drivers/add-drivers.component';
|
||||
import { PublishchooseFamifiarAddComponent } from '../choose-famifiar/add/add.component';
|
||||
|
||||
const BADGE: STColumnBadge = {
|
||||
1: { text: '空闲', color: 'success' },
|
||||
2: { text: '未实名', color: 'error' },
|
||||
3: { text: '在途', color: 'warning' },
|
||||
};
|
||||
|
||||
@Component({
|
||||
selector: 'app-supply-management-assigned-car',
|
||||
templateUrl: './assigned-car-bulk.component.html',
|
||||
})
|
||||
export class SupplyManagementBulkAssignedCarComponent implements OnInit {
|
||||
schema: SFSchema = {};
|
||||
columns!: STColumn[];
|
||||
i: any;
|
||||
ui!: SFUISchema;
|
||||
sfExpand = false;
|
||||
@ViewChild('st', { static: false })
|
||||
st!: STComponent;
|
||||
@ViewChild('sf', { static: false })
|
||||
sf!: SFComponent;
|
||||
|
||||
@ViewChild('st2', { static: false })
|
||||
st2!: STComponent;
|
||||
columns2!: STColumn[];
|
||||
st2Data: STData[] = [];
|
||||
|
||||
@Input()
|
||||
submitUrl = '';
|
||||
|
||||
@Input()
|
||||
submitParams = {};
|
||||
hasSelectedDrivers = [];
|
||||
|
||||
constructor(
|
||||
private modal: NzModalRef,
|
||||
public router: Router,
|
||||
public ar: ActivatedRoute,
|
||||
public service: SupplyManagementService,
|
||||
private modalService: NzModalService,
|
||||
private modalHelper: ModalHelper,
|
||||
) { }
|
||||
|
||||
/**
|
||||
* 查询参数
|
||||
*/
|
||||
get reqParams() {
|
||||
return {
|
||||
...this.sf?.value,
|
||||
isManage: 0
|
||||
};
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.initSF();
|
||||
this.initST();
|
||||
this.initST2();
|
||||
this.getHasAssignedCar(this.i?.id);
|
||||
}
|
||||
|
||||
initSF() {
|
||||
this.schema = {
|
||||
properties: {
|
||||
nameOrPhone: {
|
||||
type: 'string',
|
||||
title: '',
|
||||
ui: {
|
||||
placeholder: '请输入司机姓名/手机号'
|
||||
}
|
||||
},
|
||||
carNo: {
|
||||
type: 'string',
|
||||
title: '',
|
||||
ui: {
|
||||
placeholder: '请输入车牌号'
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
this.ui = {
|
||||
'*': {
|
||||
spanLabelFixed: 10,
|
||||
grid: { span: 12, gutter: 4, }
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
initST() {
|
||||
this.columns = [
|
||||
{
|
||||
title: '司机姓名',
|
||||
index: 'name'
|
||||
},
|
||||
{
|
||||
title: '手机号',
|
||||
index: 'telephone'
|
||||
},
|
||||
|
||||
{
|
||||
title: '指定车辆',
|
||||
width: 130,
|
||||
render: 'userCarLicenseDesensitizationVOList'
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
className: 'text-center',
|
||||
index: 'certificationStatus',
|
||||
type: 'badge',
|
||||
badge: {
|
||||
'-1': { text: '未提交', color: 'default' },
|
||||
0: { text: '待审核', color: 'processing' },
|
||||
1: { text: '已认证', color: 'success' },
|
||||
2: { text: '未认证', color: 'error' }
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
className: 'text-center',
|
||||
buttons: [
|
||||
{
|
||||
text: '选择',
|
||||
iif: item => !item.checked,
|
||||
click: (_record, _modal, _instance) => this.choose(_record),
|
||||
iifBehavior: 'disabled'
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
initST2() {
|
||||
this.columns2 = [
|
||||
{
|
||||
title: '司机姓名',
|
||||
index: 'name',
|
||||
className: 'text-center',
|
||||
width: '20%'
|
||||
},
|
||||
{
|
||||
title: '手机号',
|
||||
index: 'telephone',
|
||||
className: 'text-center',
|
||||
width: '15%'
|
||||
},
|
||||
{
|
||||
title: '车队长',
|
||||
render: 'captain',
|
||||
className: 'text-center',
|
||||
width: '30%'
|
||||
},
|
||||
{
|
||||
title: '指定车辆',
|
||||
render: 'carNo',
|
||||
className: 'text-center',
|
||||
width: '15%'
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
className: 'text-center',
|
||||
width: '20%',
|
||||
buttons: [
|
||||
{
|
||||
text: '移除',
|
||||
click: (_record, _modal, _instance) => this.remove(_record, _modal, _instance)
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
// 选择
|
||||
choose(record: STData) {
|
||||
this.st2Data = [...this.st2Data, ...[record]];
|
||||
this.st.setRow(record, { checked: true });
|
||||
}
|
||||
|
||||
// 移除
|
||||
remove(record: STData, value1: any, comp: any) {
|
||||
const index = this.st?.list.findIndex((obj: any) => obj.appUserId === record.appUserId);
|
||||
if (index >= 0) {
|
||||
comp!.removeRow(record);
|
||||
this.st2Data = this.st2Data.filter(item => item.appUserId !== record.appUserId);
|
||||
this.st.setRow(index, { checked: false });
|
||||
}
|
||||
}
|
||||
|
||||
//添加司机
|
||||
add() {
|
||||
this.modalService.create({
|
||||
nzTitle: '添加司机',
|
||||
nzContent: PublishchooseFamifiarAddComponent
|
||||
});
|
||||
}
|
||||
|
||||
//设置车队长
|
||||
setCaptain(record: STData) {
|
||||
|
||||
this.modalHelper.create(SupplyManagementAddDriversComponent, { dirvierInfo: record }, {
|
||||
size: 900,
|
||||
modalOptions: { nzMaskClosable: false, nzTitle: '设置' }
|
||||
}
|
||||
).subscribe((res) => {
|
||||
if (res) {
|
||||
this.st2Data = this.st2Data.map(_item => {
|
||||
if (_item?.userId === record?.userId) {
|
||||
_item.captainName = res?.name;
|
||||
_item.captainPhone = res?.mobile;
|
||||
_item.captainAppUserId = res?.appUserId;
|
||||
}
|
||||
return _item;
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置表单
|
||||
*/
|
||||
resetSF() {
|
||||
this.sf.reset();
|
||||
this.sfExpand = false;
|
||||
this.st.load(1);
|
||||
}
|
||||
|
||||
expandToggle() {
|
||||
this.sfExpand = !this.sfExpand;
|
||||
this.sf?.setValue('/_expand', this.sfExpand);
|
||||
}
|
||||
|
||||
// 熟车请求数据处理
|
||||
resProcess(data: STData[]): STData[] {
|
||||
return data.map((i, index) => {
|
||||
const defaultCart = i.userCarLicenseDesensitizationVOList.find((cart: any) => cart.isDefault);
|
||||
return { ...i, default: defaultCart || '' };
|
||||
});
|
||||
}
|
||||
|
||||
cancel() {
|
||||
this.modal.close();
|
||||
}
|
||||
|
||||
submit() {
|
||||
if (this.st2Data?.length <= 0) {
|
||||
this.service.msgSrv.warning('请选择熟车');
|
||||
return;
|
||||
}
|
||||
const data = this.st2Data.map(item => ({ driverId: item.appUserId, carId: item.default?.carId || null, carCaptainId: item.captainAppUserId }));
|
||||
this.service.request(this.service.$api_save_assign_bulk, { id: this.i?.id, carDriverIds: data }).subscribe(res => {
|
||||
if (res) {
|
||||
this.service.msgSrv.success('指派成功');
|
||||
this.modal.destroy(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
changeSt(e: STChange) {
|
||||
if (e?.type === 'loaded' && this.st2Data.length > 0) {
|
||||
// 页面加载完成时勾选
|
||||
(e?.loaded || []).forEach((r, index) => {
|
||||
this.st2Data.forEach((x) => {
|
||||
if (x.appUserId === r.appUserId) {
|
||||
this.st.setRow(index, { checked: true });
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
carChange(event: any, item: STData) {
|
||||
// this.st.setRow(item, { carName: event });
|
||||
}
|
||||
|
||||
getHasAssignedCar(id: any) {
|
||||
this.service.request(this.service.$api_get_has_assigned_car_list, { id }).subscribe(res => {
|
||||
if (res) {
|
||||
this.hasSelectedDrivers = res;
|
||||
this.st2Data = [...res];
|
||||
this.st.reload();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
@ -57,7 +57,9 @@ export class SupplyManagementVehicleAssignedCarComponent implements OnInit {
|
||||
return {
|
||||
...this.sf?.value,
|
||||
loadingTime: this.params?.loadingTime,
|
||||
unloadingTime: this.params?.unloadingTime
|
||||
enterpriseId: this.params?.shipperAppUserId,
|
||||
enterpriseProjectId: this.params?.enterpriseProjectId,
|
||||
unloadingTime: this.params?.unloadingTime,
|
||||
};
|
||||
}
|
||||
|
||||
@ -107,9 +109,20 @@ export class SupplyManagementVehicleAssignedCarComponent implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
console.log(this.params)
|
||||
}
|
||||
|
||||
dataProcess(data: STData[]): STData[] {
|
||||
dataProcess = (data: STData[], rawData: any): STData[] => {
|
||||
if (rawData.status === 505016) {
|
||||
this.modalSrv.confirm({
|
||||
nzTitle: '系统提示',
|
||||
nzContent: '<b>该司机还未注册,是否邀请他注册?点击"是"系统将发送邀请短信给司机</b>',
|
||||
nzOkText: '确定',
|
||||
nzCancelText: '取消',
|
||||
nzOnOk: () => console.log('OK')
|
||||
});
|
||||
return [];
|
||||
}
|
||||
return data.map((i, index) => {
|
||||
i.carId = '';
|
||||
i.disabled = (i?.certificationStatus === 1 && i.driverStatus === 1);
|
||||
|
||||
@ -158,6 +158,9 @@
|
||||
<sv label="回单类型">
|
||||
{{ i?.supplementaryInformationVO?.receiptTypeLabel }}
|
||||
</sv>
|
||||
<sv label="联系人">
|
||||
{{ i?.supplementaryInformationVO?.receiptUserName ? i?.supplementaryInformationVO?.receiptUserName + '/' : '' }} {{ i?.supplementaryInformationVO?.phon }}
|
||||
</sv>
|
||||
<sv label="所在地区">
|
||||
{{ i?.supplementaryInformationVO?.area }}
|
||||
</sv>
|
||||
|
||||
@ -176,50 +176,31 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
},
|
||||
dispatchPhone: {
|
||||
type: 'string',
|
||||
title: '手机号',
|
||||
maxLength: 30,
|
||||
ui: {
|
||||
hidden: true,
|
||||
placeholder: '请输入'
|
||||
}
|
||||
},
|
||||
dispatchName: {
|
||||
type: 'string',
|
||||
title: '名字',
|
||||
title: '调度员姓名',
|
||||
maxLength: 30,
|
||||
ui: {
|
||||
hidden: true,
|
||||
optionalHelp: '选若未填写,司机直接联系您',
|
||||
placeholder: '请输入'
|
||||
}
|
||||
},
|
||||
dispatchId: {
|
||||
dispatchPhone: {
|
||||
type: 'string',
|
||||
title: '调度员',
|
||||
ui: {
|
||||
widget: 'select',
|
||||
placeholder: '请选择',
|
||||
allowClear: true,
|
||||
change: (value: any, data: any) => {
|
||||
if (data.label) {
|
||||
const dat = data.label.split('/');
|
||||
this.sf1.setValue('/dispatchName', dat[0]);
|
||||
this.sf1.setValue('/dispatchPhone', dat[1]);
|
||||
}
|
||||
},
|
||||
optionalHelp: '选择调度员,司机直接联系调度员 ; 不选择,司机直接联系您',
|
||||
asyncData: () => this.shipperSrv.getStaffList2()
|
||||
} as SFSelectWidgetSchema
|
||||
}
|
||||
title: '调度员手机号',
|
||||
maxLength: 30,
|
||||
ui: {
|
||||
placeholder: '请输入'
|
||||
}
|
||||
},
|
||||
},
|
||||
required: ['shipperAppUserId', 'enterpriseProjectId', 'enterpriseInfoId', 'deadlineTime']
|
||||
required: ['shipperAppUserId', 'enterpriseProjectId', 'enterpriseInfoName', 'deadlineTime']
|
||||
};
|
||||
this.ui1 = {
|
||||
'*': {
|
||||
spanLabelFixed: 120,
|
||||
grid: { span: 8 }
|
||||
}
|
||||
spanLabelFixed: 115,
|
||||
grid: { span: 12 }
|
||||
},
|
||||
};
|
||||
}
|
||||
initSF3() {
|
||||
@ -281,6 +262,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
||||
goodsName1: {
|
||||
type: 'string',
|
||||
title: '',
|
||||
maxLength: 20,
|
||||
ui: {
|
||||
errors: { required: '请填写货物名称' },
|
||||
visibleIf: {
|
||||
@ -289,7 +271,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
},
|
||||
required: ['goodsTypeId', 'goodsName', 'goodsNameId']
|
||||
required: ['goodsTypeId', 'goodsName', 'goodsNameId','goodsName1']
|
||||
};
|
||||
this.ui3 = {
|
||||
'*': {
|
||||
@ -717,7 +699,9 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
||||
...this.sf1.value,
|
||||
...this.sf7.value,
|
||||
unLoadingPlaceDTOList: LoadingList,
|
||||
goodsInfoDTOList: goodsInfoDTOList
|
||||
goodsInfoDTOList: goodsInfoDTOList,
|
||||
estimatedKilometers: this.totalDistance,
|
||||
estimatedTravelTime: this.totalTime,
|
||||
};
|
||||
params.freightPrice = this.totalFees;
|
||||
const modalRef = this.modalService.create({
|
||||
@ -904,6 +888,8 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
||||
if (res?.enterpriseProjectId) {
|
||||
this.enterpriseProjectIds = res.enterpriseProjectId;
|
||||
}
|
||||
this.totalDistance = res?.estimatedKilometers;
|
||||
this.totalTime = res?.estimatedTravelTime;
|
||||
this.sf1data = {
|
||||
dispatchPhone: res?.dispatchPhone,
|
||||
dispatchName: res?.dispatchName,
|
||||
@ -911,7 +897,6 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
||||
enterpriseProjectId: res?.enterpriseProjectId || '',
|
||||
enterpriseInfoName: res?.enterpriseInfoName || '',
|
||||
externalResourceCode: res?.externalResourceCode || '',
|
||||
dispatchId: res?.dispatchId || '',
|
||||
deadlineTime: res?.deadlineTime || ''
|
||||
};
|
||||
if (this.PageStatus === '大宗修改') {
|
||||
@ -1022,9 +1007,9 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
||||
this.sf7data = {
|
||||
stateReceipt: res?.stateReceipt,
|
||||
receiptType: res?.receiptType || '',
|
||||
receiptUserName: res?.receiptUserName || '',
|
||||
receiptAddressArea: res?.receiptAddressArea || '',
|
||||
receiptUserPhone: res?.receiptUserPhone || '',
|
||||
receiptUserName: res?.supplementaryInformationVO?.receiptUserName || '',
|
||||
receiptAddressArea: res?.supplementaryInformationVO?.area || '',
|
||||
receiptUserPhone: res?.supplementaryInformationVO?.phon || '',
|
||||
receiptAddress: res?.receiptAddress || '',
|
||||
paymentDays: res?.paymentDays || '',
|
||||
remarks: res?.remarks || ''
|
||||
|
||||
@ -7,13 +7,9 @@
|
||||
</page-header-wrapper>
|
||||
<nz-card>
|
||||
<div class="card-title">货源单设置</div>
|
||||
<div nz-row>
|
||||
<div nz-col nzSpan="12">
|
||||
<sf #sf1 [schema]="schema1" [button]="'none'" [ui]="ui1" [formData]="sf1data">
|
||||
<ng-template sf-template="enterpriseInfoName" let-i let-ui="ui"> {{ i.value }} </ng-template>
|
||||
</sf>
|
||||
</div>
|
||||
</div>
|
||||
</nz-card>
|
||||
|
||||
<nz-card>
|
||||
|
||||
@ -199,42 +199,23 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
},
|
||||
}
|
||||
},
|
||||
dispatchPhone: {
|
||||
type: 'string',
|
||||
title: '手机号',
|
||||
maxLength: 11,
|
||||
ui: {
|
||||
hidden: true,
|
||||
placeholder: '请输入'
|
||||
}
|
||||
},
|
||||
dispatchName: {
|
||||
type: 'string',
|
||||
title: '名字',
|
||||
title: '调度员姓名',
|
||||
maxLength: 30,
|
||||
ui: {
|
||||
hidden: true,
|
||||
optionalHelp: '选若未填写,司机直接联系您',
|
||||
placeholder: '请输入'
|
||||
}
|
||||
},
|
||||
dispatchId: {
|
||||
dispatchPhone: {
|
||||
type: 'string',
|
||||
title: '调度员',
|
||||
ui: {
|
||||
widget: 'select',
|
||||
placeholder: '请选择',
|
||||
allowClear: true,
|
||||
change: (value: any, data: any) => {
|
||||
if(data.label) {
|
||||
const dat = data.label.split('/')
|
||||
this.sf1.setValue('/dispatchName', dat[0]);
|
||||
this.sf1.setValue('/dispatchPhone', dat[1]);
|
||||
}
|
||||
},
|
||||
optionalHelp: '选择调度员,司机直接联系调度员 ; 不选择,司机直接联系您',
|
||||
asyncData: () => this.shipperSrv.getStaffList2()
|
||||
} as SFSelectWidgetSchema
|
||||
}
|
||||
title: '调度员手机号',
|
||||
maxLength: 30,
|
||||
ui: {
|
||||
placeholder: '请输入'
|
||||
}
|
||||
},
|
||||
},
|
||||
required: ['shipperAppUserId', 'enterpriseProjectId','enterpriseInfoName','enterpriseInfoId', 'deadlineTime',]
|
||||
};
|
||||
@ -307,6 +288,7 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
goodsName1: {
|
||||
type: 'string',
|
||||
title: '',
|
||||
maxLength: 20,
|
||||
ui: {
|
||||
errors: { required: '请填写货物名称' },
|
||||
visibleIf: {
|
||||
@ -315,7 +297,7 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
},
|
||||
required: ['goodsTypeId', 'goodsName', 'goodsNameId']
|
||||
required: ['goodsTypeId', 'goodsName', 'goodsNameId','goodsName1']
|
||||
};
|
||||
this.ui3 = {
|
||||
'*': {
|
||||
@ -638,7 +620,9 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
...this.sf1.value,
|
||||
unLoadingPlaceDTOList: LoadingList,
|
||||
goodsInfoDTOList: goodsInfoList,
|
||||
...this.sf6.value
|
||||
...this.sf6.value,
|
||||
estimatedKilometers: this.totalDistance,
|
||||
estimatedTravelTime: this.totalTime,
|
||||
};
|
||||
const modalRef = this.modalService.create({
|
||||
nzTitle: '运输协议',
|
||||
|
||||
@ -2,14 +2,12 @@ import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
import { STColumn, STComponent, STRequestOptions } from '@delon/abc/st';
|
||||
import { SFComponent, SFDateWidgetSchema, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
|
||||
import { ModalHelper, _HttpClient } from '@delon/theme';
|
||||
import { _HttpClient } from '@delon/theme';
|
||||
import { ShipperBaseService } from '@shared';
|
||||
import { NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { of } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { SupplyManagementService } from '../../services/supply-management.service';
|
||||
import { SupplyManagementBulkAssignedCarComponent } from '../assigned-car-bulk/assigned-car-bulk.component';
|
||||
import { PublishGoodsChooseFamifiarComponent } from '../choose-famifiar/choose-famifiar.component';
|
||||
import { SupplyManagementQrcodePageComponent } from '../qrcode-page/qrcode-page.component';
|
||||
import { SupplyManagementUpdatePriceComponent } from '../update-price/update-price.component';
|
||||
|
||||
|
||||
@ -1,17 +1,15 @@
|
||||
import { ChangeDetectorRef, Component, Input, OnInit, ViewChild } from '@angular/core';
|
||||
import { Component, Input, OnInit, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { STChange, STColumn, STComponent, STData, STRequestOptions } from '@delon/abc/st';
|
||||
import { SFComponent, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
|
||||
import { STColumn, STComponent, STData } from '@delon/abc/st';
|
||||
import { SFComponent, SFSchema, SFUISchema } from '@delon/form';
|
||||
import { ModalHelper } from '@delon/theme';
|
||||
import { EAEnvironmentService, processSingleSort } from '@shared';
|
||||
import { NzDrawerRef, NzDrawerService } from 'ng-zorro-antd/drawer';
|
||||
import { EAEnvironmentService } from '@shared';
|
||||
import { NzDrawerService } from 'ng-zorro-antd/drawer';
|
||||
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { SupplyManagementAddDriversComponent } from 'src/app/routes/supply-management/components/add-drivers/add-drivers.component';
|
||||
|
||||
import { SupplyManagementService } from '../../services/supply-management.service';
|
||||
import { CarAddmodalComponent } from '../addmodal/addmodal.component';
|
||||
import { PublishchooseFamifiarAddComponent } from './add/add.component';
|
||||
import { PublishchooseFamifiarSetCaptainComponent } from './set-captain/set-captain.component';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'app-publish-goods-choose-famifiar',
|
||||
@ -37,7 +35,7 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit {
|
||||
submitUrl = '';
|
||||
|
||||
@Input()
|
||||
submitParams:any;
|
||||
submitParams: any;
|
||||
|
||||
constructor(
|
||||
private modal: NzModalRef,
|
||||
@ -241,7 +239,17 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit {
|
||||
}
|
||||
|
||||
// 熟车请求数据处理
|
||||
reqProcess(data: STData[]): STData[] {
|
||||
reqProcess = (data: STData[], rawData: any): STData[] => {
|
||||
if (rawData.status === 505016) {
|
||||
this.modalService.confirm({
|
||||
nzTitle: '系统提示',
|
||||
nzContent: '<b>该司机还未注册,是否邀请他注册?点击"是"系统将发送邀请短信给司机</b>',
|
||||
nzOkText: '确定',
|
||||
nzCancelText: '取消',
|
||||
nzOnOk: () => console.log('OK')
|
||||
});
|
||||
return [];
|
||||
}
|
||||
return data.map((i, index) => {
|
||||
const defaultCart = i.userCarLicenseDesensitizationVOList.find((cart: any) => cart.isDefault);
|
||||
return { ...i, default: defaultCart || '' };
|
||||
@ -271,52 +279,52 @@ export class PublishGoodsChooseFamifiarComponent implements OnInit {
|
||||
}
|
||||
|
||||
carChange(event: any, item: STData) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证车辆的状态
|
||||
*/
|
||||
verifyVechicleStatus(_record: STData) {
|
||||
const { carId, appUserId: driverId, captainAppUserId: carCaptainId } = _record;
|
||||
const carInfo: any = { carId, driverId, carCaptainId };
|
||||
const goodsInfoList = this.submitParams?.goodsInfoList;
|
||||
this.service.request(this.service.$api_verify_vehicle_status, { ...carInfo, goodsInfoList }).subscribe((res: any) => {
|
||||
if (res) {
|
||||
const { title, alert, subContent, content } = res;
|
||||
switch (alert) {
|
||||
case 'Error':
|
||||
this.error(title, content, subContent);
|
||||
break;
|
||||
case 'Warn':
|
||||
this.showConfirm(_record, title, content, subContent);
|
||||
break;
|
||||
case 'Success':
|
||||
this.choose(_record);
|
||||
break;
|
||||
}
|
||||
/**
|
||||
* 验证车辆的状态
|
||||
*/
|
||||
verifyVechicleStatus(_record: STData) {
|
||||
const { carId, appUserId: driverId, captainAppUserId: carCaptainId } = _record;
|
||||
const carInfo: any = { carId, driverId, carCaptainId };
|
||||
const goodsInfoList = this.submitParams?.goodsInfoList;
|
||||
this.service.request(this.service.$api_verify_vehicle_status, { ...carInfo, goodsInfoList }).subscribe((res: any) => {
|
||||
if (res) {
|
||||
const { title, alert, subContent, content } = res;
|
||||
switch (alert) {
|
||||
case 'Error':
|
||||
this.error(title, content, subContent);
|
||||
break;
|
||||
case 'Warn':
|
||||
this.showConfirm(_record, title, content, subContent);
|
||||
break;
|
||||
case 'Success':
|
||||
this.choose(_record);
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
error(title: string, content: string, subContent: string): void {
|
||||
this.modalService.error({
|
||||
nzTitle: title,
|
||||
nzContent: `<span class="text-error-dark">${content ? content : ''}</span><span class="text-grey-dark">${subContent ? subContent : ''}</span>`,
|
||||
nzOkText: '知道了'
|
||||
});
|
||||
}
|
||||
|
||||
showConfirm(_record: STData, title: string, content: string, subContent: string): void {
|
||||
this.modalService.confirm({
|
||||
nzTitle: title,
|
||||
nzContent: `<span class="text-error-dark">${content ? content : ''}</span><span class="text-grey-dark">${subContent ? subContent : ''}</span>`,
|
||||
nzOkText: '继续',
|
||||
nzCancelText: '取消',
|
||||
nzOnOk: () => {
|
||||
this.choose(_record);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
error(title: string, content: string, subContent: string): void {
|
||||
this.modalService.error({
|
||||
nzTitle: title,
|
||||
nzContent: `<span class="text-error-dark">${content ? content : ''}</span><span class="text-grey-dark">${subContent ? subContent : ''}</span>`,
|
||||
nzOkText: '知道了'
|
||||
});
|
||||
}
|
||||
|
||||
showConfirm(_record: STData, title: string, content: string, subContent: string): void {
|
||||
this.modalService.confirm({
|
||||
nzTitle: title,
|
||||
nzContent: `<span class="text-error-dark">${content ? content : ''}</span><span class="text-grey-dark">${subContent ? subContent : ''}</span>`,
|
||||
nzOkText: '继续',
|
||||
nzCancelText: '取消',
|
||||
nzOnOk: () => {
|
||||
this.choose(_record);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -177,6 +177,7 @@
|
||||
<ng-template #endInconTemp1><i nz-icon nzType="environment" nzTheme="outline"></i></ng-template>
|
||||
</form>
|
||||
</nz-card>
|
||||
|
||||
<nz-card>
|
||||
<div class="card-title">货物信息</div>
|
||||
<div nz-row>
|
||||
@ -187,47 +188,32 @@
|
||||
<sf #sf4 [schema]="schema4" [button]="'none'" [ui]="ui4" [formData]="sf4data">
|
||||
<ng-template sf-template="weight" let-i let-ui="ui">
|
||||
<nz-input-group [nzAddOnAfter]="'吨'">
|
||||
<input
|
||||
nz-input
|
||||
type="number"
|
||||
[ngModel]="i.value"
|
||||
min="0"
|
||||
step="0.01"
|
||||
(ngModelChange)="i.setValue($event)"
|
||||
placeholder="总重量,必填"
|
||||
oninput="if(value>99999)value=99999;if(value<0)value=0"
|
||||
/>
|
||||
<input nz-input type="number" [ngModel]="i.value" min="0" step="0.01" (ngModelChange)="i.setValue($event)"
|
||||
placeholder="总重量,必填" oninput="if(value>99999)value=99999;if(value<0)value=0" />
|
||||
</nz-input-group>
|
||||
</ng-template>
|
||||
<ng-template sf-template="volume" let-i let-ui="ui">
|
||||
<nz-input-group [nzAddOnAfter]="'方'">
|
||||
<input
|
||||
nz-input
|
||||
type="number"
|
||||
[ngModel]="i.value"
|
||||
min="0"
|
||||
step="0.01"
|
||||
(ngModelChange)="i.setValue($event)"
|
||||
placeholder="体积"
|
||||
oninput="if(value>99999)value=99999;if(value<0)value=0"
|
||||
/>
|
||||
<input nz-input type="number" [ngModel]="i.value" min="0" step="0.01" (ngModelChange)="i.setValue($event)"
|
||||
placeholder="体积" oninput="if(value>99999)value=99999;if(value<0)value=0" />
|
||||
</nz-input-group>
|
||||
</ng-template>
|
||||
<ng-template sf-template="number" let-i let-ui="ui">
|
||||
<nz-input-group [nzAddOnAfter]="'件'">
|
||||
<input
|
||||
nz-input
|
||||
type="number"
|
||||
[ngModel]="i.value"
|
||||
min="0"
|
||||
(ngModelChange)="i.setValue($event)"
|
||||
placeholder="车次"
|
||||
oninput="if(value>99999)value=99999;if(value<0)value=0"
|
||||
/>
|
||||
<input nz-input type="number" [ngModel]="i.value" min="0" (ngModelChange)="i.setValue($event)" placeholder="件数"
|
||||
oninput="if(value>99999)value=99999;if(value<0)value=0" />
|
||||
</nz-input-group>
|
||||
</ng-template>
|
||||
<ng-template sf-template="goodsValue" let-i let-ui="ui">
|
||||
<div class="align-center">
|
||||
<nz-input-number [ngModel]="i.value" [nzMin]="50000" [nzMax]="2000000" [nzStep]="0.01"
|
||||
(ngModelChange)="i.setValue($event);getInsurersPrice()" nzPlaceHolder="请输入50000-2000000之间数值">
|
||||
</nz-input-number>
|
||||
</div>
|
||||
</ng-template>
|
||||
</sf>
|
||||
</nz-card>
|
||||
|
||||
<nz-card>
|
||||
<div class="card-title">服务信息</div>
|
||||
<div nz-row>
|
||||
@ -239,34 +225,8 @@
|
||||
<ng-template sf-template="freeInsurance2" let-i let-ui="ui">
|
||||
<nz-alert nzType="warning" [nzMessage]="template1" nzShowIcon></nz-alert>
|
||||
</ng-template>
|
||||
<ng-template #template1>推荐投保,填写货值自动估保费,司机接单后不可退保。详见<a target="_blank" [queryParams]="{ type: 10 }" [routerLink]="['/agreement']">《投保告知》</a></ng-template>
|
||||
<ng-template sf-template="goodsValue" let-i let-ui="ui">
|
||||
<div class="align-center">
|
||||
<nz-input-number
|
||||
[ngModel]="i.value"
|
||||
[nzMin]="50000"
|
||||
[nzMax]="2000000"
|
||||
[nzStep]="0.01"
|
||||
(ngModelChange)="i.setValue($event);getInsurersPrice()"
|
||||
nzPlaceHolder="请输入50000-2000000之间数值"
|
||||
></nz-input-number>
|
||||
</div>
|
||||
</ng-template>
|
||||
<ng-template sf-template="insurancePremium" let-i let-ui="ui">
|
||||
<div class="align-center">
|
||||
<input nz-input placeholder="保价费金额" [ngModel]="i.value" [disabled]="true" />
|
||||
<span style="padding: 0 12px" nz-tooltip [nzTooltipTitle]="template2" nzTooltipPlacement="bottom"
|
||||
><i nz-icon nzType="exclamation-circle" nzTheme="outline" style="color: #1890ff"></i
|
||||
></span>
|
||||
<ng-template #template2>
|
||||
<p>注意事项:</p>
|
||||
<p>①请仔细阅读《投保告知函》;</p>
|
||||
<p>②香港、澳门、台湾、西藏、新疆不在投保范围内,不予承保;</p>
|
||||
<p>③最低保费12元/每单;单次运输保额仅限200万元以内;</p>
|
||||
<p>④本保险只限于货物起运前投保,起运后投保无效,保险人不负赔偿责任;</p>
|
||||
</ng-template>
|
||||
</div>
|
||||
</ng-template>
|
||||
<ng-template #template1>香港、澳门、台湾、西藏、新疆不予承保,单次运输保额仅限200万元以内,详见<a target="_blank" [queryParams]="{ type: 10 }"
|
||||
[routerLink]="['/agreement']">《投保告知》</a></ng-template>
|
||||
</sf>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -50,3 +50,7 @@ input[type='number']::-webkit-outer-spin-button {
|
||||
margin: 0;
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
.hides {
|
||||
margin-left: 10px;
|
||||
color: aqua;
|
||||
}
|
||||
|
||||
@ -188,6 +188,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
widget: 'text'
|
||||
}
|
||||
},
|
||||
|
||||
externalResourceCode: {
|
||||
type: 'string',
|
||||
title: '外部货源号',
|
||||
@ -196,50 +197,58 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
placeholder: '请输入'
|
||||
}
|
||||
},
|
||||
dispatchPhone: {
|
||||
type: 'string',
|
||||
title: '手机号',
|
||||
maxLength: 30,
|
||||
ui: {
|
||||
hidden: true,
|
||||
placeholder: '请输入'
|
||||
}
|
||||
},
|
||||
dispatchName: {
|
||||
type: 'string',
|
||||
title: '名字',
|
||||
title: '调度员姓名',
|
||||
maxLength: 30,
|
||||
ui: {
|
||||
hidden: true,
|
||||
optionalHelp: '选若未填写,司机直接联系您',
|
||||
placeholder: '请输入'
|
||||
}
|
||||
},
|
||||
dispatchId: {
|
||||
dispatchPhone: {
|
||||
type: 'string',
|
||||
title: '调度员',
|
||||
ui: {
|
||||
widget: 'select',
|
||||
placeholder: '请选择',
|
||||
allowClear: true,
|
||||
optionalHelp: '选择调度员,司机直接联系调度员 ; 不选择,司机直接联系您',
|
||||
change: (_value: any, data: any) => {
|
||||
if (data.label) {
|
||||
const dat = data.label.split('/');
|
||||
this.sf1.setValue('/dispatchName', dat[0]);
|
||||
this.sf1.setValue('/dispatchPhone', dat[1]);
|
||||
}
|
||||
},
|
||||
asyncData: () => this.shipperSrv.getStaffList2()
|
||||
} as SFSelectWidgetSchema
|
||||
}
|
||||
title: '调度员手机号',
|
||||
maxLength: 30,
|
||||
ui: {
|
||||
placeholder: '请输入'
|
||||
}
|
||||
},
|
||||
// dispatchId: {
|
||||
// type: 'string',
|
||||
// title: '调度员',
|
||||
// ui: {
|
||||
// widget: 'select',
|
||||
// placeholder: '请选择',
|
||||
// allowClear: true,
|
||||
// optionalHelp: '选择调度员,司机直接联系调度员 ; 不选择,司机直接联系您',
|
||||
// change: (_value: any, data: any) => {
|
||||
// if (data.label) {
|
||||
// const dat = data.label.split('/');
|
||||
// this.sf1.setValue('/dispatchName', dat[0]);
|
||||
// this.sf1.setValue('/dispatchPhone', dat[1]);
|
||||
// }
|
||||
// },
|
||||
// asyncData: () => this.shipperSrv.getStaffList2()
|
||||
// } as SFSelectWidgetSchema
|
||||
// },
|
||||
},
|
||||
required: ['shipperAppUserId', 'enterpriseProjectId']
|
||||
};
|
||||
this.ui1 = {
|
||||
'*': {
|
||||
spanLabelFixed: 120,
|
||||
grid: { span: 8 }
|
||||
}
|
||||
spanLabelFixed: 115,
|
||||
grid: { span: 12 }
|
||||
},
|
||||
$enterpriseInfoName: {
|
||||
grid: { span: 12 }
|
||||
},
|
||||
$shipperAppUserId: {
|
||||
grid: { span: 12 }
|
||||
},
|
||||
$enterpriseProjectId: {
|
||||
grid: { span: 12 }
|
||||
},
|
||||
};
|
||||
}
|
||||
initSF3() {
|
||||
@ -301,6 +310,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
goodsName1: {
|
||||
type: 'string',
|
||||
title: '',
|
||||
maxLength: 20,
|
||||
ui: {
|
||||
errors: { required: '请填写货物名称' },
|
||||
visibleIf: {
|
||||
@ -309,7 +319,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
},
|
||||
required: ['goodsTypeId', 'goodsName', 'goodsNameId']
|
||||
required: ['goodsTypeId', 'goodsName', 'goodsNameId','goodsName1']
|
||||
};
|
||||
this.ui3 = {
|
||||
'*': {
|
||||
@ -327,7 +337,8 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
placeholder: '请输入',
|
||||
errors: { required: '必填项' }
|
||||
errors: { required: '必填项' },
|
||||
validator: val => this.customValidator(val)
|
||||
}
|
||||
},
|
||||
volume: {
|
||||
@ -335,7 +346,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
title: '',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
placeholder: '请输入'
|
||||
placeholder: '请输入',
|
||||
}
|
||||
},
|
||||
number: {
|
||||
@ -343,7 +354,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
title: '',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
placeholder: '请输入'
|
||||
placeholder: '请输入',
|
||||
}
|
||||
},
|
||||
carModel: {
|
||||
@ -375,37 +386,60 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
asyncData: () => this.service.getDictOptions({ dictKey: 'car:length' }),
|
||||
change: (tag: any, org: any) => {
|
||||
if (tag.includes('999')) {
|
||||
this.sf4.setValue('/carModel', ['999']);
|
||||
this.sf4.setValue('/carLength', ['999']);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
hidenField: {
|
||||
type: 'string',
|
||||
title: '',
|
||||
default: ' ',
|
||||
ui: {
|
||||
widget: 'text'
|
||||
}
|
||||
},
|
||||
insurancePackagedGoods: {
|
||||
type: 'string',
|
||||
title: '货物包装',
|
||||
ui: {
|
||||
widget: 'dict-select',
|
||||
params: { dictKey: 'insure:packaged:goods' },
|
||||
containsAllLabel: false,
|
||||
validator: val => {
|
||||
if (this.sf5.value.insuranceType !=='3' && this.isEmpty(val)) {
|
||||
return [{ keyword: 'required', message: '必填项' }];
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
} as SFSelectWidgetSchema
|
||||
},
|
||||
goodsValue: {
|
||||
type: 'string',
|
||||
title: '货物价值',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
validator: val => {
|
||||
if (this.sf5.value.insuranceType !=='3' && this.isEmpty(val)) {
|
||||
return [{ keyword: 'required', message: '必填项' }];
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
required: ['weight', 'carModel', 'carLength']
|
||||
};
|
||||
this.ui4 = {
|
||||
'*': {
|
||||
spanLabelFixed: 90,
|
||||
grid: { span: 24 }
|
||||
},
|
||||
$weight: {
|
||||
grid: { lg: 8, md: 12, sm: 12, xs: 24 }
|
||||
},
|
||||
$volume: {
|
||||
grid: { lg: 8, md: 12, sm: 12, xs: 24 }
|
||||
},
|
||||
$number: {
|
||||
grid: { lg: 8, md: 12, sm: 12, xs: 24 }
|
||||
},
|
||||
$carModel: {
|
||||
spanLabelFixed: 100,
|
||||
grid: { span: 8 }
|
||||
},
|
||||
$carLength: {
|
||||
spanLabelFixed: 115,
|
||||
grid: { span: 8 }
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
initSF5() {
|
||||
this.schema5 = {
|
||||
properties: {
|
||||
@ -435,73 +469,30 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
type1: {
|
||||
type: 'string',
|
||||
title: '',
|
||||
enum: ['资源曝光率 +10', '车源匹配率 +10'],
|
||||
enum: ['货源曝光率 +10', '车源匹配率 +10'],
|
||||
readOnly: true,
|
||||
ui: {
|
||||
widget: 'checkbox',
|
||||
visibleIf: { insuranceType: (value: string) => value === '0' }
|
||||
} as SFCheckboxWidgetSchema,
|
||||
default: ['资源曝光率 +10', '车源匹配率 +10']
|
||||
default: ['货源曝光率 +10', '车源匹配率 +10']
|
||||
},
|
||||
type2: {
|
||||
type: 'string',
|
||||
title: '',
|
||||
enum: ['资源曝光率 +20', '车源匹配率 +20'],
|
||||
enum: ['货源曝光率 +20', '车源匹配率 +20'],
|
||||
readOnly: true,
|
||||
ui: {
|
||||
widget: 'checkbox',
|
||||
visibleIf: { insuranceType: (value: string) => value === '1' }
|
||||
} as SFCheckboxWidgetSchema,
|
||||
default: ['资源曝光率 +20', '车源匹配率 +20']
|
||||
},
|
||||
freeInsurance1: {
|
||||
type: 'string',
|
||||
title: '赠送基本险',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
visibleIf: { insuranceType: (value: string) => value === '0' }
|
||||
}
|
||||
},
|
||||
freeInsurance2: {
|
||||
type: 'string',
|
||||
title: '赠送综合险',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
visibleIf: { insuranceType: (value: string) => value === '1' }
|
||||
}
|
||||
},
|
||||
insurancePackagedGoods: {
|
||||
type: 'string',
|
||||
title: '货物包装',
|
||||
ui: {
|
||||
widget: 'dict-select',
|
||||
params: { dictKey: 'insure:packaged:goods' },
|
||||
containsAllLabel: false,
|
||||
visibleIf: { insuranceType: (value: string) => value !== '3' }
|
||||
} as SFSelectWidgetSchema
|
||||
},
|
||||
hidenField: {
|
||||
type: 'string',
|
||||
title: '',
|
||||
default: ' ',
|
||||
ui: {
|
||||
widget: 'text'
|
||||
}
|
||||
},
|
||||
goodsValue: {
|
||||
type: 'string',
|
||||
title: '货物价值',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
visibleIf: { insuranceType: (value: string) => value !== '3' }
|
||||
}
|
||||
default: ['货源曝光率 +20', '车源匹配率 +20']
|
||||
},
|
||||
insurancePremium: {
|
||||
type: 'string',
|
||||
title: '',
|
||||
title: '服务包费用',
|
||||
readOnly:true,
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
validator: val => this.customValidator(val),
|
||||
visibleIf: { insuranceType: (value: string) => value !== '3' }
|
||||
}
|
||||
},
|
||||
@ -511,9 +502,27 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
ui: {
|
||||
hidden: true
|
||||
}
|
||||
}
|
||||
},
|
||||
freeInsurance1: {
|
||||
type: 'string',
|
||||
title: '预投基本险',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
visibleIf: { insuranceType: (value: string) => value === '0' }
|
||||
}
|
||||
},
|
||||
freeInsurance2: {
|
||||
type: 'string',
|
||||
title: '预投综合险',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
visibleIf: { insuranceType: (value: string) => value === '1' }
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
required: ['insurancePackagedGoods', 'insurancePremium']
|
||||
required: [ 'insurancePremium']
|
||||
};
|
||||
this.ui5 = {
|
||||
'*': {
|
||||
@ -534,6 +543,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 自定义校验数据
|
||||
* @param val
|
||||
@ -648,19 +658,16 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
prePay: {
|
||||
type: 'number',
|
||||
title: '预付',
|
||||
default: 0,
|
||||
ui: { widget: 'custom' }
|
||||
},
|
||||
toPay: {
|
||||
type: 'number',
|
||||
title: '到付',
|
||||
default: 0,
|
||||
ui: { widget: 'custom' }
|
||||
},
|
||||
receiptPay: {
|
||||
type: 'number',
|
||||
title: '回单付',
|
||||
default: 0,
|
||||
ui: { widget: 'custom' }
|
||||
},
|
||||
subtotal: { type: 'number', title: '小计', default: 0, ui: { widget: 'custom' } as SFNumberWidgetSchema },
|
||||
@ -992,7 +999,11 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
...this.sf5.value,
|
||||
...this.sf6.value,
|
||||
expenseDTOList: expenseList,
|
||||
paymentDays: this.sf7.value.paymentDays
|
||||
paymentDays: this.sf7.value.paymentDays,
|
||||
estimatedKilometers: this.totalDistance,
|
||||
estimatedTravelTime: this.totalTime,
|
||||
insurancePackagedGoods:this.sf4.value.insurancePackagedGoods,
|
||||
goodsValue:this.sf4.value.goodsValue,
|
||||
};
|
||||
const modalRef = this.modalService.create({
|
||||
nzTitle: '运输协议',
|
||||
@ -1117,13 +1128,14 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
if (res?.enterpriseProjectId) {
|
||||
this.enterpriseProjectIds = res.enterpriseProjectId;
|
||||
}
|
||||
this.totalDistance = res?.estimatedKilometers;
|
||||
this.totalTime = res?.estimatedTravelTime;
|
||||
this.sf1data = {
|
||||
enterpriseInfoName: res?.enterpriseInfoName,
|
||||
enterpriseInfoId: res?.enterpriseInfoId,
|
||||
dispatchPhone: res?.dispatchPhone,
|
||||
dispatchName: res?.dispatchName,
|
||||
externalResourceCode: res?.externalResourceCode,
|
||||
dispatchId: res?.dispatchId
|
||||
};
|
||||
if (this.PageStatus === '整车修改') {
|
||||
this.sf1data.id = res?.id;
|
||||
@ -1233,7 +1245,9 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
volume: res?.goodsInfoVOList[0]?.volume || '',
|
||||
number: res?.goodsInfoVOList[0]?.number || '',
|
||||
carModel: res?.goodsInfoVOList[0]?.carModel?.split(',') || [],
|
||||
carLength: res?.goodsInfoVOList[0]?.carLength?.split(',') || []
|
||||
carLength: res?.goodsInfoVOList[0]?.carLength?.split(',') || [],
|
||||
goodsValue: res?.goodsValue || '',
|
||||
insurancePackagedGoods: res?.insurancePackagedGoods || '',
|
||||
};
|
||||
if (this.PageStatus === '整车修改') {
|
||||
this.sf4data.id = res?.goodsInfoVOList[0]?.id;
|
||||
@ -1241,18 +1255,16 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
this.totalFees = res?.shippingInformationVO?.totalFee || '0';
|
||||
this.sf5data = {
|
||||
insuranceType: res?.insuranceType || '',
|
||||
goodsValue: res?.goodsValue || '',
|
||||
insurancePremium: res?.insurancePremium || '',
|
||||
insuranceRate: res?.insuranceRate || '',
|
||||
insurancePackagedGoods: res?.insurancePackagedGoods || ''
|
||||
};
|
||||
this.sf6data = {
|
||||
stateReceipt: res?.stateReceipt,
|
||||
receiptType: res?.receiptType || '',
|
||||
receiptUserName: res?.receiptUserName || '',
|
||||
receiptAddressArea: res?.receiptAddressArea || '',
|
||||
receiptUserPhone: res?.receiptUserPhone || '',
|
||||
receiptAddress: res?.receiptAddress || '',
|
||||
receiptUserName: res?.supplementaryInformationVO?.receiptUserName || '',
|
||||
receiptAddressArea: res?.supplementaryInformationVO?.area || '',
|
||||
receiptUserPhone: res?.supplementaryInformationVO?.phon || '',
|
||||
receiptAddress: res?.supplementaryInformationVO.address || '',
|
||||
remarks: res?.supplementaryInformationVO?.remarks || ''
|
||||
};
|
||||
this.sf7data = {
|
||||
@ -1371,17 +1383,17 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
}
|
||||
// 计算保价费金额
|
||||
getInsurersPrice(insuranceType = this.sf5.value.insuranceType) {
|
||||
if (this.sf5.value.goodsValue >= 50000 && this.totalDistance > 0) {
|
||||
if ( this.sf5.value.insuranceType !=='3' && this.sf4.value.goodsValue >= 50000 && this.totalDistance > 0 ) {
|
||||
const params = {
|
||||
insuranceType,
|
||||
goodsValue: this.sf5.value.goodsValue,
|
||||
goodsValue: this.sf4.value.goodsValue,
|
||||
km: this.totalDistance
|
||||
};
|
||||
this.service.request(this.service.$api_getWholeInsuranceInfo, params).subscribe(res => {
|
||||
if (res) {
|
||||
this.sf5.setValue('/insurancePremium', res.insurancePremium);
|
||||
this.sf5.setValue('/insuranceRate', res.insuranceRate);
|
||||
} else {
|
||||
}else{
|
||||
this.sf5.setValue('/insurancePremium', null);
|
||||
this.sf5.setValue('/insuranceRate', null);
|
||||
}
|
||||
|
||||
@ -7,13 +7,9 @@
|
||||
</page-header-wrapper>
|
||||
<nz-card>
|
||||
<div class="card-title">货源单设置</div>
|
||||
<div nz-row>
|
||||
<div nz-col nzSpan="12">
|
||||
<sf #sf1 [schema]="schema1" [button]="'none'" [ui]="ui1" [formData]="sf1data">
|
||||
<ng-template sf-template="enterpriseInfoName" let-i let-ui="ui"> {{ i.value }} </ng-template>
|
||||
</sf>
|
||||
</div>
|
||||
</div>
|
||||
</nz-card>
|
||||
|
||||
<nz-card>
|
||||
@ -184,55 +180,43 @@
|
||||
</form>
|
||||
</nz-card>
|
||||
|
||||
|
||||
<nz-card>
|
||||
<div class="card-title">货物信息</div>
|
||||
<div nz-row>
|
||||
<div nz-col nzSpan="24">
|
||||
<div nz-col nzSpan="16">
|
||||
<sf #sf3 [schema]="schema3" [button]="'none'" [ui]="ui3" [formData]="sf3data"></sf>
|
||||
<sf #sf4 [schema]="schema4" [button]="'none'" [ui]="ui4" [formData]="sf4data">
|
||||
<ng-template sf-template="weight" let-i let-ui="ui">
|
||||
<nz-input-group [nzAddOnAfter]="'吨'">
|
||||
<input
|
||||
nz-input
|
||||
type="number"
|
||||
[ngModel]="i.value"
|
||||
min="0"
|
||||
step="0.01"
|
||||
(ngModelChange)="i.setValue($event)"
|
||||
placeholder="总重量,必填"
|
||||
/>
|
||||
</nz-input-group>
|
||||
</ng-template>
|
||||
<ng-template sf-template="volume" let-i let-ui="ui">
|
||||
<nz-input-group [nzAddOnAfter]="'方'">
|
||||
<input
|
||||
nz-input
|
||||
type="number"
|
||||
[ngModel]="i.value"
|
||||
min="0"
|
||||
step="0.01"
|
||||
(ngModelChange)="i.setValue($event)"
|
||||
placeholder="总体积"
|
||||
/>
|
||||
</nz-input-group>
|
||||
</ng-template>
|
||||
<ng-template sf-template="number" let-i let-ui="ui">
|
||||
<nz-input-group [nzAddOnAfter]="'车'">
|
||||
<input
|
||||
nz-input
|
||||
type="number"
|
||||
[ngModel]="i.value"
|
||||
min="0"
|
||||
step="0.01"
|
||||
(ngModelChange)="i.setValue($event)"
|
||||
placeholder="总车次"
|
||||
/>
|
||||
</nz-input-group>
|
||||
</ng-template>
|
||||
</sf>
|
||||
</div>
|
||||
</div>
|
||||
<sf #sf4 [schema]="schema4" [button]="'none'" [ui]="ui4" [formData]="sf4data">
|
||||
<ng-template sf-template="weight" let-i let-ui="ui">
|
||||
<nz-input-group [nzAddOnAfter]="'吨'">
|
||||
<input nz-input type="number" [ngModel]="i.value" min="0" step="0.01" (ngModelChange)="i.setValue($event)"
|
||||
placeholder="总重量,必填" oninput="if(value>99999)value=99999;if(value<0)value=0" />
|
||||
</nz-input-group>
|
||||
</ng-template>
|
||||
<ng-template sf-template="volume" let-i let-ui="ui">
|
||||
<nz-input-group [nzAddOnAfter]="'方'">
|
||||
<input nz-input type="number" [ngModel]="i.value" min="0" step="0.01" (ngModelChange)="i.setValue($event)"
|
||||
placeholder="体积" oninput="if(value>99999)value=99999;if(value<0)value=0" />
|
||||
</nz-input-group>
|
||||
</ng-template>
|
||||
<ng-template sf-template="number" let-i let-ui="ui">
|
||||
<nz-input-group [nzAddOnAfter]="'件'">
|
||||
<input nz-input type="number" [ngModel]="i.value" min="0" (ngModelChange)="i.setValue($event)" placeholder="件数"
|
||||
oninput="if(value>99999)value=99999;if(value<0)value=0" />
|
||||
</nz-input-group>
|
||||
</ng-template>
|
||||
<ng-template sf-template="goodsValue" let-i let-ui="ui">
|
||||
<div class="align-center">
|
||||
<nz-input-number [ngModel]="i.value" [nzMin]="50000" [nzMax]="2000000" [nzStep]="0.01"
|
||||
(ngModelChange)="i.setValue($event);getInsurersPrice()" nzPlaceHolder="请输入50000-2000000之间数值">
|
||||
</nz-input-number>
|
||||
</div>
|
||||
</ng-template>
|
||||
</sf>
|
||||
</nz-card>
|
||||
|
||||
<nz-card>
|
||||
<div class="card-title">服务信息</div>
|
||||
<div nz-row>
|
||||
@ -244,34 +228,8 @@
|
||||
<ng-template sf-template="freeInsurance2" let-i let-ui="ui">
|
||||
<nz-alert nzType="warning" [nzMessage]="template1" nzShowIcon></nz-alert>
|
||||
</ng-template>
|
||||
<ng-template #template1>推荐投保,填写货值自动估保费,司机接单后不可退保。详见<a target="_blank" [queryParams]="{ type: 10 }" [routerLink]="['/agreement']">《投保告知》</a></ng-template>
|
||||
<ng-template sf-template="goodsValue" let-i let-ui="ui">
|
||||
<div class="align-center">
|
||||
<nz-input-number
|
||||
[ngModel]="i.value"
|
||||
[nzMin]="50000"
|
||||
[nzMax]="2000000"
|
||||
[nzStep]="0.01"
|
||||
(ngModelChange)="i.setValue($event);getInsurersPrice()"
|
||||
nzPlaceHolder="请输入50000-2000000之间数值"
|
||||
></nz-input-number>
|
||||
</div>
|
||||
</ng-template>
|
||||
<ng-template sf-template="insurancePremium" let-i let-ui="ui">
|
||||
<div class="align-center">
|
||||
<input nz-input placeholder="保价费金额" [ngModel]="i.value" [disabled]="true" />
|
||||
<span style="padding: 0 12px" nz-tooltip [nzTooltipTitle]="template2" nzTooltipPlacement="bottom"
|
||||
><i nz-icon nzType="exclamation-circle" nzTheme="outline" style="color: #1890ff"></i
|
||||
></span>
|
||||
<ng-template #template2>
|
||||
<p>注意事项:</p>
|
||||
<p>①请仔细阅读《投保告知函》;</p>
|
||||
<p>②香港、澳门、台湾、西藏、新疆不在投保范围内,不予承保;</p>
|
||||
<p>③最低保费12元/每单;单次运输保额仅限200万元以内;</p>
|
||||
<p>④本保险只限于货物起运前投保,起运后投保无效,保险人不负赔偿责任;</p>
|
||||
</ng-template>
|
||||
</div>
|
||||
</ng-template>
|
||||
<ng-template #template1>香港、澳门、台湾、西藏、新疆不予承保,单次运输保额仅限200万元以内,详见<a target="_blank" [queryParams]="{ type: 10 }"
|
||||
[routerLink]="['/agreement']">《投保告知》</a></ng-template>
|
||||
</sf>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -176,14 +176,6 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
allowClear: true
|
||||
} as SFSelectWidgetSchema
|
||||
},
|
||||
// enterpriseInfoName: {
|
||||
// type: 'string',
|
||||
// title: '网络货运人',
|
||||
// ui: {
|
||||
// widget: 'custom'
|
||||
// },
|
||||
// default: '天津市怡亚通XXXX有限公司'
|
||||
// },
|
||||
enterpriseInfoName: {
|
||||
type: 'string',
|
||||
title: '网络货运人',
|
||||
@ -203,52 +195,42 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
placeholder: '请输入'
|
||||
}
|
||||
},
|
||||
dispatchPhone: {
|
||||
type: 'string',
|
||||
title: '手机号',
|
||||
maxLength: 30,
|
||||
ui: {
|
||||
hidden: true,
|
||||
placeholder: '请输入'
|
||||
}
|
||||
},
|
||||
dispatchName: {
|
||||
type: 'string',
|
||||
title: '名字',
|
||||
title: '调度员姓名',
|
||||
maxLength: 30,
|
||||
ui: {
|
||||
hidden: true,
|
||||
optionalHelp: '选若未填写,司机直接联系您',
|
||||
placeholder: '请输入'
|
||||
}
|
||||
},
|
||||
dispatchId: {
|
||||
dispatchPhone: {
|
||||
type: 'string',
|
||||
title: '调度员',
|
||||
ui: {
|
||||
widget: 'select',
|
||||
placeholder: '请选择',
|
||||
allowClear: true,
|
||||
change: (_value: any, data: any) => {
|
||||
if (data.label) {
|
||||
const dat = data.label.split('/');
|
||||
this.sf1.setValue('/dispatchName', dat[0]);
|
||||
this.sf1.setValue('/dispatchPhone', dat[1]);
|
||||
}
|
||||
},
|
||||
optionalHelp: '选择调度员,司机直接联系调度员 ; 不选择,司机直接联系您',
|
||||
asyncData: () => this.shipperSrv.getStaffList2()
|
||||
} as SFSelectWidgetSchema
|
||||
}
|
||||
title: '调度员手机号',
|
||||
maxLength: 30,
|
||||
ui: {
|
||||
placeholder: '请输入'
|
||||
}
|
||||
},
|
||||
},
|
||||
required: ['shipperAppUserId', 'enterpriseProjectId', 'enterpriseInfoName']
|
||||
};
|
||||
this.ui1 = {
|
||||
'*': {
|
||||
spanLabelFixed: 110,
|
||||
spanLabelFixed: 115,
|
||||
grid: { span: 12 }
|
||||
},
|
||||
$enterpriseInfoName: {
|
||||
grid: { span: 24 }
|
||||
grid: { span: 12 }
|
||||
},
|
||||
$shipperAppUserId: {
|
||||
grid: { span: 12 }
|
||||
},
|
||||
$enterpriseProjectId: {
|
||||
grid: { span: 12 }
|
||||
},
|
||||
$dispatchId: {
|
||||
grid: { span: 12 }
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -311,6 +293,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
goodsName1: {
|
||||
type: 'string',
|
||||
title: '',
|
||||
maxLength: 20,
|
||||
ui: {
|
||||
errors: { required: '请填写货物名称' },
|
||||
visibleIf: {
|
||||
@ -346,7 +329,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
title: '',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
placeholder: '请输入'
|
||||
placeholder: '请输入',
|
||||
}
|
||||
},
|
||||
number: {
|
||||
@ -354,7 +337,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
title: '',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
placeholder: '请输入'
|
||||
placeholder: '请输入',
|
||||
}
|
||||
},
|
||||
carModel: {
|
||||
@ -390,7 +373,45 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
hidenField: {
|
||||
type: 'string',
|
||||
title: '',
|
||||
default: ' ',
|
||||
ui: {
|
||||
widget: 'text'
|
||||
}
|
||||
},
|
||||
insurancePackagedGoods: {
|
||||
type: 'string',
|
||||
title: '货物包装',
|
||||
ui: {
|
||||
widget: 'dict-select',
|
||||
params: { dictKey: 'insure:packaged:goods' },
|
||||
containsAllLabel: false,
|
||||
validator: val => {
|
||||
if (this.sf5.value.insuranceType !=='3' && this.isEmpty(val)) {
|
||||
return [{ keyword: 'required', message: '必填项' }];
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
} as SFSelectWidgetSchema
|
||||
},
|
||||
goodsValue: {
|
||||
type: 'string',
|
||||
title: '货物价值',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
validator: val => {
|
||||
if (this.sf5.value.insuranceType !=='3' && this.isEmpty(val)) {
|
||||
return [{ keyword: 'required', message: '必填项' }];
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
required: ['weight', 'carModel', 'carLength']
|
||||
};
|
||||
@ -398,10 +419,6 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
'*': {
|
||||
spanLabelFixed: 115,
|
||||
grid: { span: 8 }
|
||||
},
|
||||
$carModel: {
|
||||
spanLabelFixed: 100,
|
||||
grid: { span: 8 }
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -435,73 +452,30 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
type1: {
|
||||
type: 'string',
|
||||
title: '',
|
||||
enum: ['资源曝光率 +10', '车源匹配率 +10'],
|
||||
enum: ['货源曝光率 +10', '车源匹配率 +10'],
|
||||
readOnly: true,
|
||||
ui: {
|
||||
widget: 'checkbox',
|
||||
visibleIf: { insuranceType: (value: string) => value === '0' }
|
||||
} as SFCheckboxWidgetSchema,
|
||||
default: ['资源曝光率 +10', '车源匹配率 +10']
|
||||
default: ['货源曝光率 +10', '车源匹配率 +10']
|
||||
},
|
||||
type2: {
|
||||
type: 'string',
|
||||
title: '',
|
||||
enum: ['资源曝光率 +20', '车源匹配率 +20'],
|
||||
enum: ['货源曝光率 +20', '车源匹配率 +20'],
|
||||
readOnly: true,
|
||||
ui: {
|
||||
widget: 'checkbox',
|
||||
visibleIf: { insuranceType: (value: string) => value === '1' }
|
||||
} as SFCheckboxWidgetSchema,
|
||||
default: ['资源曝光率 +20', '车源匹配率 +20']
|
||||
},
|
||||
freeInsurance1: {
|
||||
type: 'string',
|
||||
title: '赠送基本险',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
visibleIf: { insuranceType: (value: string) => value === '0' }
|
||||
}
|
||||
},
|
||||
freeInsurance2: {
|
||||
type: 'string',
|
||||
title: '赠送综合险',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
visibleIf: { insuranceType: (value: string) => value === '1' }
|
||||
}
|
||||
},
|
||||
insurancePackagedGoods: {
|
||||
type: 'string',
|
||||
title: '货物包装',
|
||||
ui: {
|
||||
widget: 'dict-select',
|
||||
params: { dictKey: 'insure:packaged:goods' },
|
||||
containsAllLabel: false,
|
||||
visibleIf: { insuranceType: (value: string) => value !== '3' }
|
||||
} as SFSelectWidgetSchema
|
||||
},
|
||||
hidenField: {
|
||||
type: 'string',
|
||||
title: '',
|
||||
default: ' ',
|
||||
ui: {
|
||||
widget: 'text'
|
||||
}
|
||||
},
|
||||
goodsValue: {
|
||||
type: 'string',
|
||||
title: '货物价值',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
visibleIf: { insuranceType: (value: string) => value !== '3' }
|
||||
}
|
||||
default: ['货源曝光率 +20', '车源匹配率 +20']
|
||||
},
|
||||
insurancePremium: {
|
||||
type: 'string',
|
||||
title: '',
|
||||
title: '服务包费用',
|
||||
readOnly:true,
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
validator: val => this.customValidator(val),
|
||||
visibleIf: { insuranceType: (value: string) => value !== '3' }
|
||||
}
|
||||
},
|
||||
@ -511,9 +485,27 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
ui: {
|
||||
hidden: true
|
||||
}
|
||||
}
|
||||
},
|
||||
freeInsurance1: {
|
||||
type: 'string',
|
||||
title: '预投基本险',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
visibleIf: { insuranceType: (value: string) => value === '0' }
|
||||
}
|
||||
},
|
||||
freeInsurance2: {
|
||||
type: 'string',
|
||||
title: '预投综合险',
|
||||
ui: {
|
||||
widget: 'custom',
|
||||
visibleIf: { insuranceType: (value: string) => value === '1' }
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
},
|
||||
required: ['insurancePackagedGoods', 'insurancePremium']
|
||||
required: [ 'insurancePremium']
|
||||
};
|
||||
this.ui5 = {
|
||||
'*': {
|
||||
@ -535,6 +527,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
initSF6() {
|
||||
this.schema6 = {
|
||||
properties: {
|
||||
@ -632,19 +625,16 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
prePay: {
|
||||
type: 'number',
|
||||
title: '预付',
|
||||
default: 0,
|
||||
ui: { widget: 'custom' }
|
||||
},
|
||||
toPay: {
|
||||
type: 'number',
|
||||
title: '到付',
|
||||
default: 0,
|
||||
ui: { widget: 'custom' }
|
||||
},
|
||||
receiptPay: {
|
||||
type: 'number',
|
||||
title: '回单付',
|
||||
default: 0,
|
||||
ui: { widget: 'custom' }
|
||||
},
|
||||
subtotal: { type: 'number', title: '小计', default: 0, ui: { widget: 'custom' } as SFNumberWidgetSchema },
|
||||
@ -942,20 +932,6 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
{ expenseCode: 'RECE', expenseName: '到付', price: this.sf7.value.toPay || 0, id: this.sf7data?.toPayId || '' },
|
||||
{ expenseCode: 'BACK', expenseName: '回单付', price: this.sf7.value.receiptPay || 0, id: this.sf7data?.receiptPayId || '' }
|
||||
];
|
||||
console.log(this.sf55?.value);
|
||||
// const params = {
|
||||
// id: '',
|
||||
// ...this.sf1.value,
|
||||
// unLoadingPlaceDTOList: LoadingList,
|
||||
// unloadingTime: format(this.validateForm1.value?.unloadingTime, 'yyyy-MM-dd HH:mm:ss'),
|
||||
// loadingTime: format(this.validateForm1.value?.loadingTime, 'yyyy-MM-dd HH:mm:ss'),
|
||||
// goodsInfoDTOList: goodsInfoList,
|
||||
// ...this.sf5.value,
|
||||
// ...this.sf6.value,
|
||||
// expenseDTOList: expenseList,
|
||||
// paymentDays: this.sf7.value?.paymentDays,
|
||||
// insuranceType:this.sf55?.value?.insuranceType,
|
||||
// };
|
||||
const params = {
|
||||
id: '',
|
||||
...this.sf1.value,
|
||||
@ -966,7 +942,11 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
...this.sf5.value,
|
||||
...this.sf6.value,
|
||||
expenseDTOList: expenseList,
|
||||
paymentDays: this.sf7.value.paymentDays
|
||||
paymentDays: this.sf7.value.paymentDays,
|
||||
estimatedKilometers: this.totalDistance,
|
||||
estimatedTravelTime: this.totalTime,
|
||||
insurancePackagedGoods:this.sf4.value.insurancePackagedGoods,
|
||||
goodsValue:this.sf4.value.goodsValue,
|
||||
};
|
||||
console.log(params);
|
||||
const modalRef = this.modalService.create({
|
||||
@ -1182,17 +1162,17 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
}
|
||||
// 计算保价费金额
|
||||
getInsurersPrice(insuranceType = this.sf5.value.insuranceType) {
|
||||
if (this.sf5.value.goodsValue >= 50000 && this.totalDistance > 0) {
|
||||
if ( this.sf5.value.insuranceType !=='3' && this.sf4.value.goodsValue >= 50000 && this.totalDistance > 0 ) {
|
||||
const params = {
|
||||
insuranceType,
|
||||
goodsValue: this.sf5.value.goodsValue,
|
||||
goodsValue: this.sf4.value.goodsValue,
|
||||
km: this.totalDistance
|
||||
};
|
||||
this.service.request(this.service.$api_getWholeInsuranceInfo, params).subscribe(res => {
|
||||
if (res) {
|
||||
this.sf5.setValue('/insurancePremium', res.insurancePremium);
|
||||
this.sf5.setValue('/insuranceRate', res.insuranceRate);
|
||||
} else {
|
||||
}else{
|
||||
this.sf5.setValue('/insurancePremium', null);
|
||||
this.sf5.setValue('/insuranceRate', null);
|
||||
}
|
||||
|
||||
@ -163,7 +163,32 @@ export class SupplyManagementVehicleComponent implements OnInit {
|
||||
});
|
||||
modalRef.afterClose.subscribe(result => {
|
||||
if (result) {
|
||||
this.st.reload();
|
||||
const tipsModal = this.modal.create({
|
||||
nzTitle: '上传提示',
|
||||
nzWidth: 600,
|
||||
nzContent: `<div>文件上传完成!成功<span class="text-blue-dark">${result?.successNumber}</span>条,失败<span class="text-red-dark">${result?.failNumber}</span>条!</div>`,
|
||||
nzFooter: [
|
||||
{
|
||||
label: '取 消',
|
||||
type: 'default',
|
||||
onClick: () => {
|
||||
tipsModal.destroy();
|
||||
}
|
||||
},
|
||||
{
|
||||
label: '下载失败数据',
|
||||
type: 'primary',
|
||||
onClick: () => {
|
||||
this.service.request(this.service.$api_getFailUploadGoodsOperateResource, result.ids).subscribe((res: any) => {
|
||||
if(res) {
|
||||
console.log(res);
|
||||
}
|
||||
})
|
||||
console.log(111);
|
||||
}
|
||||
},
|
||||
]
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user