This commit is contained in:
wangshiming
2021-12-14 20:24:42 +08:00
parent 553d22a01e
commit 7bbd8a8bc9
13 changed files with 452 additions and 272 deletions

View File

@ -106,6 +106,36 @@
<div nz-col nzSpan="12">
<sf #sf3 [schema]="schema3" [formData]="sf3data" [button]="'none'" [ui]="ui3"></sf>
<sf #sf4 [schema]="schema4" [formData]="sf4data" [button]="'none'" [ui]="ui4">
<ng-template sf-template="freightPrice" let-i let-ui="ui">
<nz-input-group [nzAddOnAfter]="addOnAfterTemplate">
<input nz-input [ngModel]="i.value" (ngModelChange)="i.setValue($event)" placeholder="请输入" />
</nz-input-group>
<ng-template #addOnAfterTemplate>
<nz-select [ngModel]="sf4.value.freightType" (ngModelChange)="sf4.setValue('/freightType', $event)">
<nz-option nzLabel="元/吨" nzValue="1"></nz-option>
<nz-option nzLabel="元/方" nzValue="2"></nz-option>
<nz-option nzLabel="元/车" nzValue="3"></nz-option>
</nz-select>
</ng-template>
</ng-template>
<ng-template sf-template="rule" let-i let-ui="ui">
<div class="align-center">
<nz-select [ngModel]="i.value" (ngModelChange)="i.setValue($event)" nzPlaceHolder="运费取整规则">
<nz-option nzLabel="保留小数" nzValue="1"></nz-option>
<nz-option nzLabel="抹除小数" nzValue="2"></nz-option>
<nz-option nzLabel="抹除个数" nzValue="3"></nz-option>
</nz-select>
<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>例如 付司机运费 = 重量*单价 = 999.99</p>
<p>保留小数,即 999.99</p>
<p>抹除小数,即 999.00</p>
<p>抹除个位,即 990.00</p>
</ng-template>
</div>
</ng-template>
<ng-template sf-template="weight" let-i let-ui="ui">
<nz-input-group [nzAddOnAfter]="''">
<input
@ -150,60 +180,11 @@
</div>
</nz-card>
<nz-card>
<div class="card-title">服务信息</div>
<div nz-row [nzGutter]="24" style="margin: 24px 0">
<div nz-col [nzSpan]="10">
<div class="align-center">
<span style="font-weight: bolder; margin-right: 24px">购买货运险</span>
<nz-alert nzType="warning" [nzMessage]="template1" nzShowIcon></nz-alert>
</div>
</div>
</div>
<ng-template #template1>推荐投保,填写货值自动估保费,司机接单后不可退保。详见<a>《投保告知》</a></ng-template>
<div nz-row>
<div nz-col nzSpan="12">
<sf #sf5 [schema]="schema5" [formData]="sf5data" [button]="'none'" [ui]="ui5">
<ng-template sf-template="goodsValue" let-i let-ui="ui">
<div class="align-center">
<input nz-input [ngModel]="i.value" (ngModelChange)="i.setValue($event)" />
<span style="padding: 0 12px" nz-tooltip [nzTooltipTitle]="template2"
><i nz-icon nzType="exclamation-circle" nzTheme="outline" style="color: #1890ff"></i
></span>
<ng-template #template2>注意事项:<br/>
①请仔细阅读《投保告知》<br/>
②港澳台、西藏不在投保范围内,不予承保<br/>
③保价费最低收费2元请按真实货值填写录入的所有信息必须确保真实不如实录入的内容不承担对应赔偿责任。</ng-template>
</div>
</ng-template>
</sf>
</div>
</div>
</nz-card>
<nz-card>
<div class="card-title">补充信息</div>
<div nz-row>
<div nz-col nzSpan="12">
<sf #sf6 [schema]="schema6" [formData]="sf6data" [button]="'none'" [ui]="ui6"></sf>
</div>
</div>
</nz-card>
<nz-card>
<div class="card-title">运费信息</div>
<div nz-row>
<div nz-col nzSpan="12">
<sf #sf7 [schema]="schema7" [formData]="sf7data" [button]="'none'" [ui]="ui7">
<ng-template sf-template="totalFee" let-i let-ui="ui" >
<div *ngIf="this.PageStatus === '整车修改' || this.PageStatus === '整车下一单'">{{totalFees | currency: '¥'}}</div>
<div *ngIf="this.PageStatus === '大宗修改' || this.PageStatus === '大宗下一单'">
<nz-input-number [(ngModel)]="totalFees" (ngModelChange)="i.setValue($event)" [nzMin]="1" [nzStep]="0.01"></nz-input-number>
</div>
</ng-template>
<ng-template sf-template="paymentDays" let-i let-ui="ui">
<div nz-row>
<div class="align-center">

View File

@ -27,7 +27,6 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
sf3data: any; // 货源单设置回显
sf4data: any; // 货源单设置回显
sf5data: any; // 货源单设置回显
sf6data: any; // 货源单设置回显
sf7data: any; // 货源单设置回显
creatTime: any; // 货源单设置回显
modifyTime: any; // 货源单设置回显
@ -69,13 +68,6 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
schema4: SFSchema = {};
ui4!: SFUISchema;
@ViewChild('sf5', { static: false }) sf5!: SFComponent;
schema5: SFSchema = {};
ui5!: SFUISchema;
@ViewChild('sf6', { static: false }) sf6!: SFComponent;
schema6: SFSchema = {};
ui6!: SFUISchema;
@ViewChild('sf7', { static: false }) sf7!: SFComponent;
schema7: SFSchema = {};
@ -95,9 +87,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
// this.initSF2();
this.initSF3();
this.initSF4();
this.initSF5();
this.initSF6();
this.initSF7();
this.initdata();
}
@ -244,13 +234,52 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
initSF4() {
this.schema4 = {
properties: {
freightPrice: {
type: 'string',
title: '运费单价',
ui: {
errors: { required: '请选择运费单价' },
widget: 'custom',
placeholder: '请输入'
}
},
freightType: {
type: 'string',
title: '',
ui: {
hidden: true
},
default: '1'
},
rule: {
type: 'string',
title: '',
ui: {
widget: 'custom',
errors: { required: '请选择运费取整规则' }
}
},
settlementBasis: {
type: 'string',
title: '',
enum: [
{ label: '以收货为准', value: '1' },
{ label: '以发货为准', value: '2' }
],
ui: {
widget: 'select',
placeholder: '结算依据',
errors: { required: '请选择结算依据' }
} as SFSelectWidgetSchema
},
weight: {
type: 'string',
title: '货物数量',
ui: {
widget: 'custom',
placeholder: '请输入',
errors: { required: '必填项' }
errors: { required: '请填写总重量' }
}
},
volume: {
@ -317,13 +346,22 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
} as SFSelectWidgetSchema
}
},
required: ['weight', 'maxWeight', 'maxCube']
required: ['weight', 'maxWeight', 'maxCube', 'freightPrice', 'rule', 'settlementBasis']
};
this.ui4 = {
'*': {
spanLabelFixed: 90,
grid: { span: 24 }
},
$freightPrice: {
grid: { span: 8 }
},
$rule: {
grid: { span: 8 }
},
$settlementBasis: {
grid: { span: 8 }
},
$weight: {
grid: { span: 8 }
},
@ -342,112 +380,21 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
};
}
initSF5() {
this.schema5 = {
properties: {
goodsValue: {
type: 'string',
title: '货物价值',
ui: {
widget: 'custom',
placeholder: '请输入'
}
}
}
};
this.ui5 = {
'*': {
spanLabelFixed: 90,
grid: { span: 24 }
}
};
changeValue() {
this.totalFees = Number(this.sf7?.value?.appendFee) + Number(this.sf7?.value?.oilCardPay) + Number(this.sf7?.value?.prePay) + Number(this.sf7?.value?.receiptPay) + Number(this.sf7?.value?.toPay)
console.log(this.totalFees)
}
initSF6() {
this.schema6 = {
this.schema7 = {
properties: {
stateReceipt: {
paymentDays: {
type: 'string',
title: '是否回单',
enum: [
{ label: '需要', value: true },
{ label: '不需要', value: false }
],
ui: {
widget: 'select',
errors: { required: '请选择' },
placeholder: '请选择'
}
},
receiptType: {
type: 'string',
title: '回单类型',
enum: [
{ label: '电子回单', value: 1 },
{ label: '纸质回单', value: 2 }
],
ui: {
widget: 'select',
placeholder: '请选择',
errors: { required: '请选择' },
visibleIf: {
stateReceipt: value => value === true
}
}
},
receiptUserId: {
type: 'string',
title: '选择地址',
title: '到货后',
ui: {
widget: 'custom',
placeholder: '请点击选择收回单地址',
validator: val => (this.sf6?.value?.receiptType === '2' ? [{ keyword: 'required', message: '请点击选择收回单地址' }] : []),
visibleIf: {
receiptType: value => value === '2'
}
},
default: '1212'
},
name4: {
type: 'string',
title: '联系人',
ui: {
visibleIf: {
receiptType: value => value === '2'
}
},
readOnly: true
},
name5: {
type: 'string',
title: '联系电话',
ui: {
visibleIf: {
receiptType: value => value === '2'
}
},
readOnly: true
},
name6: {
type: 'string',
title: '所在地区',
ui: {
visibleIf: {
receiptType: value => value === '2'
}
},
readOnly: true
},
receiptAddress: {
type: 'string',
title: '详细地址',
maxLength: 20,
ui: {
visibleIf: {
receiptType: value => value === '2'
}
},
readOnly: true
placeholder: '请输入',
errors: { required: '请输入付款承诺天数' }
}
},
remarks: {
type: 'string',
@ -460,31 +407,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
} as SFTextareaWidgetSchema
}
},
required: ['stateReceipt', 'receiptType']
};
this.ui6 = {
'*': {
spanLabelFixed: 90,
grid: { span: 24 }
}
};
}
changeValue() {
this.totalFees = Number(this.sf7?.value?.appendFee) + Number(this.sf7?.value?.oilCardPay) + Number(this.sf7?.value?.prePay) + Number(this.sf7?.value?.receiptPay) + Number(this.sf7?.value?.toPay)
console.log(this.totalFees)
}
initSF7() {
this.schema7 = {
properties: {
totalFee: {
type: 'string',
title: '总费用',
ui: {
widget: 'custom',
placeholder: '请输入'
}
}
}
required: ['paymentDays']
};
this.ui7 = {
'*': {
@ -494,6 +417,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
};
}
addStartInfo(event: any) {
if (this.startInfo.length < 5) {
const controlId = this.startInfo.length;
@ -567,9 +491,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
});
}
submit(): void {
console.log('进来了')
console.log(this.startInfo)
debugger;
// Object.keys(this.validateForm1.controls).forEach(key => {
// this.validateForm1.controls[key].markAsDirty();
// this.validateForm1.controls[key].updateValueAndValidity();
@ -577,7 +499,6 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
// this.sf1.validator({ emitError: true });
// this.sf3.validator({ emitError: true });
// this.sf4.validator({ emitError: true });
// this.sf6.validator({ emitError: true });
// if (this.validateForm1.invalid || !this.sf1.valid || !this.sf3.valid || !this.sf4.valid || !this.sf6.valid) {
// return;
// }
@ -598,8 +519,6 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
}
const params: any = {
...this.sf1.value,
...this.sf5.value,
...this.sf6.value,
unLoadingPlaceDTOList: [...this.startInfo, ...this.endInfo,],
goodsInfoDTOList: [
{
@ -756,41 +675,37 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
goodsName: res?.goodsInfoVOList[0]?.goodsName || '',
}
this.sf4data = {
weight: res?.goodsInfoVOList[0]?.weight || '',
volume: res?.goodsInfoVOList[0]?.volume || '',
vehicleDemand: res?.goodsInfoVOList[0]?.vehicleDemand || '',
maxCube: res?.goodsInfoVOList[0]?.maxCube?.split(',') || '',
// weight: res?.goodsInfoVOList[0]?.weight || '',
// volume: res?.goodsInfoVOList[0]?.volume || '',
// vehicleDemand: res?.goodsInfoVOList[0]?.vehicleDemand || '',
// maxCube: res?.goodsInfoVOList[0]?.maxCube?.split(',') || '',
// maxWeight: res?.goodsInfoVOList[0]?.maxWeight?.split(',') || '',
// number: res?.goodsInfoVOList[0]?.number || '',
// goodsType: res?.goodsInfoVOList[0]?.goodsType || '',
// modifyTime: res?.goodsInfoVOList[0]?.modifyTime || '',
// modifyUserId: res?.goodsInfoVOList[0]?.modifyUserId || '',
// resourceId: res?.goodsInfoVOList[0]?.resourceId || '',
// rule: res?.goodsInfoVOList[0]?.rule || '',
// settlementBasis: res?.goodsInfoVOList[0]?.settlementBasis || '',
freightPrice: res?.goodsInfoVOList[0]?.freightPrice || '',
freightType: res?.goodsInfoVOList[0]?.freightType || '',
rule: res?.goodsInfoVOList[0]?.rule || '',
settlementBasis: res?.goodsInfoVOList[0]?.settlementBasis || '',
weight: res?.goodsInfoVOList[0]?.weight || '',
volume: res?.goodsInfoVOList[0]?.volume || '',
number: res?.goodsInfoVOList[0]?.number || '',
maxWeight: res?.goodsInfoVOList[0]?.maxWeight?.split(',') || '',
number: res?.goodsInfoVOList[0]?.number || '',
goodsType: res?.goodsInfoVOList[0]?.goodsType || '',
modifyTime: res?.goodsInfoVOList[0]?.modifyTime || '',
modifyUserId: res?.goodsInfoVOList[0]?.modifyUserId || '',
resourceId: res?.goodsInfoVOList[0]?.resourceId || '',
rule: res?.goodsInfoVOList[0]?.rule || '',
settlementBasis: res?.goodsInfoVOList[0]?.settlementBasis || '',
maxCube: res?.goodsInfoVOList[0]?.maxCube?.split(',') || ''
}
if(this.PageStatus === '大宗修改') {
this.sf4data.id = res?.goodsInfoVOList[0]?.id;
}
this.totalFees = res?.freightPrice || '0';
this.sf5data = {
goodsValue: res?.goodsValue || '',
}
this.sf6data = {
stateReceipt: res?.supplementaryInformationVO?.stateReceipt || '',
receiptType: res?.supplementaryInformationVO?.receiptType || '',
receiptUserId: res?.supplementaryInformationVO?.receiptUserId || '',
remarks: res?.supplementaryInformationVO?.remarks || ''
};
this.sf7data = {
prePay: res?.shippingInformationVO?.prePay || '',
toPay: res?.shippingInformationVO?.toPay || '',
oilCardPay: res?.shippingInformationVO?.oilCardPay || '',
receiptPay: res?.shippingInformationVO?.receiptPay || '',
// subtotal: res?.shippingInformationVO?.oilCardPay || '',
appendFee: res?.shippingInformationVO?.appendFee || '',
paymentDays: res?.shippingInformationVO?.paymentDays || '',
}
paymentDays: res?.paymentDays || '',
remarks: res?.remarks || ''
};
}
}

View File

@ -0,0 +1,23 @@
<!--
* @Author: your name
* @Date: 2021-12-14 20:08:17
* @LastEditTime: 2021-12-14 20:09:50
* @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\onecar-publish\address-list\address-list.component.html
-->
<st
#st
[bordered]="true"
[data]="service.$api_getList"
[columns]="columns"
[req]="{ method: 'POST', allInBody: true, reName: { pi: 'pageIndex', ps: 'pageSize' }, params: reqParams, process: reqProcess }"
[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' }"
(change)="change($event)"
>
<ng-template st-row="region" let-item let-index="index"> {{ item.province }}-{{ item.city }}-{{ item.area }} </ng-template>
</st>

View File

@ -0,0 +1,86 @@
/*
* @Author: your name
* @Date: 2021-12-14 20:08:17
* @LastEditTime: 2021-12-14 20:08:55
* @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\onecar-publish\address-list\address-list.component.ts
*/
import { Component, OnInit, ViewChild } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { STChange, STColumn, STComponent, STRequestOptions } from '@delon/abc/st';
import { processSingleSort } from '@shared';
import { NzDrawerService } from 'ng-zorro-antd/drawer';
import { NzModalService } from 'ng-zorro-antd/modal';
import { SupplyManagementService } from 'src/app/routes/order-management/services/order-management.service';
@Component({
selector: 'app-publish-address-list',
templateUrl: './address-list.component.html'
})
export class PublishAddressListComponent implements OnInit {
columns!: STColumn[];
@ViewChild('st', { static: false })
st!: STComponent;
seleteData: any;
spuStatus = '1'; // '1'客户地址,'2'收回单地址
constructor(
public router: Router,
public ar: ActivatedRoute,
private drawerService: NzDrawerService,
public service: SupplyManagementService,
private modalService: NzModalService
) {}
/**
* 查询参数
*/
get reqParams() {
return {
type: this.spuStatus
};
}
ngOnInit() {
this.initST();
}
initST() {
this.columns = [
{ title: '', index: 'id', type: 'radio', width: 70 },
{
title: '省市区',
render: 'region'
},
{
title: '详细地址',
index: 'detailedAddress'
},
{
title: '联系人',
index: 'contactName'
},
{
title: '联系电话',
index: 'contactTelephone'
},
{
title: '更新时间',
index: 'modifyTime'
}
];
}
// 排序
reqProcess(requestOptions: STRequestOptions): STRequestOptions {
return processSingleSort(requestOptions);
}
change(ret: STChange): void {
console.log('change', ret);
this.seleteData = { ...ret.radio };
}
}

View File

@ -206,7 +206,17 @@
<div class="card-title">补充信息</div>
<div nz-row>
<div nz-col nzSpan="12">
<sf #sf6 [schema]="schema6" [formData]="sf6data" [button]="'none'" [ui]="ui6"></sf>
<sf #sf6 [schema]="schema6" [formData]="sf6data" [button]="'none'" [ui]="ui6">
<ng-template sf-template="receiptUserId" let-i let-ui="ui">
<input
nz-input
[ngModel]="i.value"
(ngModelChange)="i.setValue($event)"
placeholder="请点击选择收回单地址"
(click)="backBillChange()"
/>
</ng-template>
</sf>
</div>
</div>
</nz-card>

View File

@ -15,6 +15,7 @@ import { NzModalService } from 'ng-zorro-antd/modal';
import { PublishGoodsChooseFamifiarComponent } from '../choose-famifiar/choose-famifiar.component';
import { SupplyManagementService } from '../../services/supply-management.service';
import { debug } from 'console';
import { PublishAddressListComponent } from './address-list/address-list.component';
@Component({
selector: 'app-publish-goods-onecar-publish',
templateUrl: './onecar-publish.component.html',
@ -396,7 +397,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
placeholder: '请点击选择收回单地址',
validator: val => (this.sf6?.value?.receiptType === '2' ? [{ keyword: 'required', message: '请点击选择收回单地址' }] : []),
visibleIf: {
receiptType: value => value === '2'
receiptType: value => value === 2
}
},
default: '1212'
@ -406,7 +407,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
title: '联系人',
ui: {
visibleIf: {
receiptType: value => value === '2'
receiptType: value => value === 2
}
},
readOnly: true
@ -416,7 +417,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
title: '联系电话',
ui: {
visibleIf: {
receiptType: value => value === '2'
receiptType: value => value === 2
}
},
readOnly: true
@ -426,7 +427,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
title: '所在地区',
ui: {
visibleIf: {
receiptType: value => value === '2'
receiptType: value => value === 2
}
},
readOnly: true
@ -437,7 +438,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
maxLength: 20,
ui: {
visibleIf: {
receiptType: value => value === '2'
receiptType: value => value === 2
}
},
readOnly: true
@ -628,6 +629,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
...this.sf1.value,
...this.sf5.value,
...this.sf6.value,
paymentDays: this.sf7.value.paymentDays,
loadingTime: this.validateForm1?.value?.loadingTime,
unloadingTime: this.validateForm1?.value?.unloadingTime,
unLoadingPlaceDTOList: [...this.startInfo, ...this.endInfo,],
@ -831,7 +833,23 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
receiptPay: res?.shippingInformationVO?.receiptPay ,
// subtotal: res?.shippingInformationVO?.oilCardPay ,
appendFee: res?.shippingInformationVO?.appendFee ,
paymentDays: res?.shippingInformationVO?.paymentDays ,
paymentDays: res?.paymentDays ,
}
}
backBillChange() {
const modalRef = this.modalService.create({
nzTitle: '选择收回单地址',
nzContent: PublishAddressListComponent,
nzWidth: 900,
nzComponentParams: { spuStatus: '2' },
nzOnOk: item => {
const data = item.seleteData;
if (JSON.stringify(data) === '{}') return;
this.sf6.setValue('/name4', data.contactName);
this.sf6.setValue('/name5', data.contactTelephone);
this.sf6.setValue('/name6', `${data.province}-${data.city}-${data.area}`);
this.sf6.setValue('/receiptAddress', data.detailedAddress);
}
});
}
}