车辆对接
This commit is contained in:
@ -26,7 +26,6 @@ import { PublishAddressListComponent } from '../onecar-publish/address-list/addr
|
||||
})
|
||||
export class SupplyManagementBulkPublishComponent implements OnInit {
|
||||
validateForm1: FormGroup;
|
||||
newTempchecked = false; //是否存入新模板
|
||||
sf1data: any; // 货源单设置回显
|
||||
sf3data: any; // 货源单设置回显
|
||||
sf4data: any; // 货源单设置回显
|
||||
@ -39,15 +38,11 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
||||
totalTime = 0.0; //路程总时间
|
||||
currentGoodsTypeName: any;
|
||||
enterpriseProjectIds: any;
|
||||
id = this.route.snapshot.params.id;
|
||||
id = this.route.snapshot.params.id; // 传参id
|
||||
// // 单位
|
||||
unit1 = '吨';
|
||||
unit2 = '方';
|
||||
unit3 = '保价费金额';
|
||||
startInfo: any = [];
|
||||
endInfo: any = [];
|
||||
PageStatus = '';
|
||||
dataList: any;
|
||||
constructor(
|
||||
private http: _HttpClient,
|
||||
fb: FormBuilder,
|
||||
@ -84,17 +79,12 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
||||
schema4: SFSchema = {};
|
||||
ui4!: SFUISchema;
|
||||
|
||||
|
||||
@ViewChild('sf7', { static: false }) sf7!: SFComponent;
|
||||
schema7: SFSchema = {};
|
||||
ui7!: SFUISchema;
|
||||
// 初始化
|
||||
ngOnInit(): void {
|
||||
if(this.route.snapshot?.queryParams?.sta === '1') {
|
||||
console.log('修改')
|
||||
this.PageStatus = '整车修改';
|
||||
} else if(this.route.snapshot?.queryParams?.sta === '2') {
|
||||
this.PageStatus = '整车下一单';
|
||||
} else if(this.route.snapshot?.queryParams?.sta === '3') {
|
||||
if(this.route.snapshot?.queryParams?.sta === '3') {
|
||||
this.PageStatus = '大宗修改';
|
||||
} else if(this.route.snapshot?.queryParams?.sta === '4') {
|
||||
this.PageStatus = '大宗下一单';
|
||||
@ -105,9 +95,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
||||
this.initSF6();
|
||||
this.initdata();
|
||||
}
|
||||
|
||||
initSF1() {
|
||||
|
||||
this.schema1 = {
|
||||
properties: {
|
||||
shipperAppUserId: {
|
||||
@ -207,28 +195,6 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
||||
}
|
||||
};
|
||||
}
|
||||
// 获取城市列表
|
||||
getRegionCode(regionCode: any) {
|
||||
console.log(regionCode);
|
||||
return this.service
|
||||
.request(this.service.$api_get_enterprise_project, { id: regionCode })
|
||||
.pipe(
|
||||
map(res =>
|
||||
res.map((item: any) => ({
|
||||
label: item.projectName,
|
||||
value: item.id
|
||||
}))
|
||||
)
|
||||
)
|
||||
.subscribe(res => {
|
||||
this.sf1.getProperty('/enterpriseProjectId')!.schema.enum = res;
|
||||
this.sf1.getProperty('/enterpriseProjectId')!.widget.reset(res);
|
||||
if(this.enterpriseProjectIds) {
|
||||
this.sf1.setValue('/enterpriseProjectId', this.enterpriseProjectIds);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
initSF3() {
|
||||
this.schema3 = {
|
||||
properties: {
|
||||
@ -428,11 +394,6 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
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.schema7 = {
|
||||
properties: {
|
||||
@ -545,8 +506,29 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
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)
|
||||
}
|
||||
// 获取城市列表
|
||||
getRegionCode(regionCode: any) {
|
||||
return this.service
|
||||
.request(this.service.$api_get_enterprise_project, { id: regionCode })
|
||||
.pipe(
|
||||
map(res =>
|
||||
res.map((item: any) => ({
|
||||
label: item.projectName,
|
||||
value: item.id
|
||||
}))
|
||||
)
|
||||
)
|
||||
.subscribe(res => {
|
||||
this.sf1.getProperty('/enterpriseProjectId')!.schema.enum = res;
|
||||
this.sf1.getProperty('/enterpriseProjectId')!.widget.reset(res);
|
||||
if(this.enterpriseProjectIds) {
|
||||
this.sf1.setValue('/enterpriseProjectId', this.enterpriseProjectIds);
|
||||
}
|
||||
});
|
||||
}
|
||||
addStartInfo(event: any) {
|
||||
if (this.startInfo.length < 5) {
|
||||
const controlId = this.startInfo.length;
|
||||
@ -567,10 +549,8 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
subStartInfo(event: any, index: number, id?:any) {
|
||||
console.log(event, index, id)
|
||||
if(id) {
|
||||
this.service.request(this.service.$api_delete_Wholedeletebatch, [id]).subscribe((res) => {
|
||||
console.log(res)
|
||||
})
|
||||
}
|
||||
this.startInfo.splice(index, 1);
|
||||
@ -578,7 +558,6 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
||||
this.validateForm1.removeControl(`loadName${index}`);
|
||||
this.validateForm1.removeControl(`loadPhone${index}`);
|
||||
}
|
||||
|
||||
addEndInfo(event: any) {
|
||||
if (this.addEndInfo.length < 5) {
|
||||
const controlId = this.endInfo.length;
|
||||
@ -601,17 +580,13 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
||||
subEndInfo(event: any, index: number, id?:any) {
|
||||
if(id) {
|
||||
this.service.request(this.service.$api_delete_Wholedeletebatch, [id]).subscribe((res) => {
|
||||
console.log(res)
|
||||
})
|
||||
}
|
||||
console.log(event, index, id)
|
||||
this.endInfo.splice(index, 1);
|
||||
this.validateForm1.removeControl(`unloadAddress${index}`);
|
||||
this.validateForm1.removeControl(`unloadName${index}`);
|
||||
this.validateForm1.removeControl(`unloadPhone${index}`);
|
||||
}
|
||||
|
||||
//指派熟车
|
||||
// 指派熟车
|
||||
chooseFamifiar(item: any) {
|
||||
const modalRef = this.modalService.create({
|
||||
@ -639,7 +614,9 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
||||
nzComponentParams: { type: 'bulk' }
|
||||
});
|
||||
}
|
||||
// 确认提交
|
||||
submit(submitType?: string): void {
|
||||
// 校验规则
|
||||
Object.keys(this.validateForm1.controls).forEach(key => {
|
||||
this.validateForm1.controls[key].markAsDirty();
|
||||
this.validateForm1.controls[key].updateValueAndValidity();
|
||||
@ -651,7 +628,6 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
||||
if (this.validateForm1.invalid || !this.sf3.valid || !this.sf1.valid|| !this.sf4.valid || !this.sf7.valid) {
|
||||
return;
|
||||
}
|
||||
console.log(this.startInfo)
|
||||
if(typeof(this.validateForm1.value.modifyTime) !== 'string' ) {
|
||||
var c = new Date(this.validateForm1.value.modifyTime);
|
||||
this.validateForm1.value.modifyTime = c.getFullYear() + '-' + (c.getMonth() + 1) + '-' + c.getDate() + ' ' + c.getHours() + ':' + c.getMinutes() + ':' + c.getSeconds()
|
||||
@ -680,14 +656,12 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
||||
return;
|
||||
}
|
||||
}
|
||||
console.log(params)
|
||||
if(this.PageStatus === '大宗修改') {
|
||||
this.requests(this.service.$api_set_bulkModify, params);
|
||||
} else if(this.PageStatus === '大宗下一单') {
|
||||
this.requests(this.service.$api_set_saveAnotherBulkOrder, params);
|
||||
}
|
||||
}
|
||||
|
||||
requests(url: any, params: any) {
|
||||
this.service.request(url, params).subscribe((res: any) => {
|
||||
if (res) {
|
||||
@ -798,12 +772,10 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
||||
this.dataR(res);
|
||||
})
|
||||
}
|
||||
asds(i: any) {
|
||||
console.log(i)
|
||||
}
|
||||
|
||||
// 初始化信息
|
||||
dataR (res: any) {
|
||||
// this.dataList = res;
|
||||
// 注:区分编辑和下一单 区别是初始化的时候加不加ID
|
||||
if (res?.shipperAppUserName) {
|
||||
const List: any = [];
|
||||
this.service.request(this.service.$api_enterpriceList, { enterpriseName: res?.shipperAppUserName }).subscribe(rs => {
|
||||
@ -942,9 +914,11 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
||||
remarks: res?.remarks || ''
|
||||
};
|
||||
}
|
||||
// 回退
|
||||
choose(){
|
||||
window.history.go(-1);
|
||||
}
|
||||
// 选择地址
|
||||
chooseAddress(index: number, type: string) {
|
||||
const modalRef = this.modalService.create({
|
||||
nzTitle: '选择地址',
|
||||
@ -952,8 +926,6 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
||||
nzWidth: 900,
|
||||
nzComponentParams: { spuStatus: '1' },
|
||||
nzOnOk: item => {
|
||||
console.log(item)
|
||||
console.log(type)
|
||||
const data = item.seleteData;
|
||||
if (JSON.stringify(data) === '{}') return;
|
||||
switch (type) {
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormBuilder, FormControl, FormGroup, NgForm, Validators } from '@angular/forms';
|
||||
import { NgForm } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import {
|
||||
SFArrayWidgetSchema,
|
||||
SFComponent,
|
||||
SFNumberWidgetSchema,
|
||||
SFSchema,
|
||||
SFSchemaEnum,
|
||||
SFSelectWidgetSchema,
|
||||
@ -13,18 +11,14 @@ import {
|
||||
} from '@delon/form';
|
||||
import { SettingsService, _HttpClient } from '@delon/theme';
|
||||
import { ShipperBaseService } from '@shared';
|
||||
import format from 'date-fns/format';
|
||||
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { of } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { AmapPoiPickerComponent, AmapService } from 'src/app/shared/components/amap';
|
||||
import { SupplyManagementService } from '../../services/supply-management.service';
|
||||
import { PublishGoodsChooseFamifiarComponent } from '../choose-famifiar/choose-famifiar.component';
|
||||
|
||||
// import { PublishGoodsChooseFamifiarComponent } from '../choose-famifiar-bulk/choose-famifiar.component';
|
||||
import { PublishAddressListComponent } from '../onecar-publish/address-list/address-list.component';
|
||||
import { PublishSuccessComponent } from '../onecar-publish/publish-success/publish-success.component';
|
||||
// import { PublishSuccessComponent } from '../publish-success/publish-success.component';
|
||||
@Component({
|
||||
selector: 'app-publish-goods-bulk-publish',
|
||||
templateUrl: './bulk-release-publish.component.html',
|
||||
@ -33,7 +27,6 @@ import { PublishSuccessComponent } from '../onecar-publish/publish-success/publi
|
||||
export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
@ViewChild('ngForm')
|
||||
ngForm!: NgForm;
|
||||
|
||||
sf1data: any; // 货源单设置回显
|
||||
sf3data: any; // 货源单设置回显
|
||||
sf4data: any; // 货源单设置回显
|
||||
@ -46,19 +39,11 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
id = '';
|
||||
type = 'add';
|
||||
// // 单位
|
||||
unit1 = '吨';
|
||||
unit2 = '方';
|
||||
unit3 = '保价费金额';
|
||||
startInfo: any[] = [];
|
||||
endInfo: any[] = [];
|
||||
|
||||
totalDistance = 0.0; //总里程
|
||||
totalTime = 0.0; //路程总时间
|
||||
|
||||
currentGoodsTypeName: any;
|
||||
|
||||
freightTypeOptions: any;
|
||||
ruleOptions: any;
|
||||
constructor(
|
||||
private http: _HttpClient,
|
||||
private modalService: NzModalService,
|
||||
@ -69,7 +54,6 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
private amapService: AmapService,
|
||||
public shipperSrv: ShipperBaseService
|
||||
) {}
|
||||
|
||||
@ViewChild('sf1', { static: false }) sf1!: SFComponent;
|
||||
schema1: SFSchema = {};
|
||||
ui1!: SFUISchema;
|
||||
@ -85,7 +69,7 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
@ViewChild('sf6', { static: false }) sf6!: SFComponent;
|
||||
schema6: SFSchema = {};
|
||||
ui6!: SFUISchema;
|
||||
|
||||
// 初始化
|
||||
ngOnInit(): void {
|
||||
this.initSF1();
|
||||
this.initSF3();
|
||||
@ -118,7 +102,6 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
initSF1() {
|
||||
this.schema1 = {
|
||||
properties: {
|
||||
@ -231,7 +214,6 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
initSF3() {
|
||||
this.schema3 = {
|
||||
properties: {
|
||||
@ -430,7 +412,6 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
initSF6() {
|
||||
this.schema6 = {
|
||||
properties: {
|
||||
@ -543,6 +524,7 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
}
|
||||
};
|
||||
}
|
||||
// 选择收回单地址
|
||||
backBillChange() {
|
||||
const modalRef = this.modalService.create({
|
||||
nzTitle: '选择收回单地址',
|
||||
@ -587,6 +569,7 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
nzComponentParams: { type: 'bulk' }
|
||||
});
|
||||
}
|
||||
// 确认提交(下单)
|
||||
submit(submitType: string): void {
|
||||
Object.keys(this.ngForm.form.controls).forEach(key => {
|
||||
this.ngForm.form.controls[key].markAsDirty();
|
||||
@ -599,7 +582,6 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
if (this.ngForm.form.invalid || !this.sf1.valid || !this.sf3.valid || !this.sf4.valid || !this.sf6.valid) {
|
||||
return;
|
||||
}
|
||||
|
||||
// //装卸货信息
|
||||
const LoadingList = this.startInfo.concat(this.endInfo);
|
||||
// 货物信息
|
||||
@ -626,7 +608,6 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
|
||||
let reqUrl = this.service.$api_consignBulk;
|
||||
if (submitType === 'assign') {
|
||||
console.log('params', params);
|
||||
this.chooseFamifiar(params);
|
||||
} else {
|
||||
this.service.request(reqUrl, params).subscribe(res => {
|
||||
@ -644,7 +625,6 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
}
|
||||
// 获取城市列表
|
||||
getRegionCode(regionCode: any) {
|
||||
console.log(regionCode);
|
||||
return this.service
|
||||
.request(this.service.$api_get_enterprise_project, { id: regionCode })
|
||||
.pipe(
|
||||
@ -698,7 +678,7 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 选择地址
|
||||
chooseAddress(index: number, type: string) {
|
||||
const modalRef = this.modalService.create({
|
||||
nzTitle: '选择地址',
|
||||
@ -741,6 +721,7 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
// 返回上一页
|
||||
goBack() {
|
||||
window.history.go(-1);
|
||||
}
|
||||
@ -772,7 +753,4 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
choose() {
|
||||
window.history.go(-1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -280,7 +280,7 @@
|
||||
</nz-card>
|
||||
<nz-card>
|
||||
<div class="align-center">
|
||||
<button nz-button nzType="primary" *ngIf="this.PageStatus == '整车修改'" (click)="choose()">取消</button>
|
||||
<button nz-button nzType="primary" *ngIf="this.PageStatus == '整车修改'" (click)="goBack()">取消</button>
|
||||
<button *ngIf="this.PageStatus == '整车修改'" nz-button nzType="primary" style="margin-left: 48px" (click)="submit()">提交修改</button>
|
||||
<button nz-button nzType="primary" *ngIf="this.PageStatus == '整车下一单'" (click)="submitConfirm('assign')">指派熟车</button>
|
||||
<button *ngIf="this.PageStatus == '整车下一单'" nz-button nzType="primary" style="margin-left: 48px" (click)="submit()"
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
||||
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import {
|
||||
SFComponent,
|
||||
@ -13,15 +13,13 @@ import {
|
||||
import { _HttpClient } from '@delon/theme';
|
||||
import { AmapPoiPickerComponent, AmapService, ShipperBaseService } from '@shared';
|
||||
import { NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { PublishGoodsChooseFamifiarComponent } from '../choose-famifiar/choose-famifiar.component';
|
||||
import { of } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { SupplyManagementService } from '../../services/supply-management.service';
|
||||
import { debug } from 'console';
|
||||
import { SupplyManagementVehicleAssignedCarComponent } from '../assigned-car/assigned-car.component';
|
||||
import { TranAgreementComponent } from '../tran-agreement/tran-agreement.component';
|
||||
import { PublishAddressListComponent } from './address-list/address-list.component';
|
||||
import { PublishSuccessComponent } from './publish-success/publish-success.component';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { of } from 'rxjs';
|
||||
import { TranAgreementComponent } from '../tran-agreement/tran-agreement.component';
|
||||
import { SupplyManagementVehicleAssignedCarComponent } from '../assigned-car/assigned-car.component';
|
||||
@Component({
|
||||
selector: 'app-publish-goods-onecar-publish',
|
||||
templateUrl: './onecar-publish.component.html',
|
||||
@ -29,7 +27,6 @@ import { SupplyManagementVehicleAssignedCarComponent } from '../assigned-car/ass
|
||||
})
|
||||
export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
validateForm1: FormGroup;
|
||||
newTempchecked = false; //是否存入新模板
|
||||
sf1data: any; // 货源单设置回显
|
||||
sf3data: any; // 货源单设置回显
|
||||
sf4data: any; // 货源单设置回显
|
||||
@ -43,17 +40,11 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
totalDistance = 0.0; //总里程
|
||||
totalTime = 0.0; //路程总时间
|
||||
currentRate = 0; //实时计算的费率
|
||||
|
||||
npp = false;
|
||||
id = this.route.snapshot.params.id;
|
||||
// // 单位
|
||||
unit1 = '吨';
|
||||
unit2 = '方';
|
||||
unit3 = '保价费金额';
|
||||
startInfo: any = [];
|
||||
endInfo: any = [];
|
||||
startInfo: any = []; // 发货地数据
|
||||
endInfo: any = []; // 卸货地数据
|
||||
PageStatus = '';
|
||||
dataList: any;
|
||||
enterpriseProjectIds: any;
|
||||
constructor(
|
||||
private http: _HttpClient,
|
||||
@ -97,16 +88,12 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
@ViewChild('sf7', { static: false }) sf7!: SFComponent;
|
||||
schema7: SFSchema = {};
|
||||
ui7!: SFUISchema;
|
||||
// 页面初始化
|
||||
ngOnInit(): void {
|
||||
if (this.route.snapshot?.queryParams?.sta === '1') {
|
||||
console.log('修改');
|
||||
this.PageStatus = '整车修改';
|
||||
} else if (this.route.snapshot?.queryParams?.sta === '2') {
|
||||
this.PageStatus = '整车下一单';
|
||||
} else if (this.route.snapshot?.queryParams?.sta === '3') {
|
||||
this.PageStatus = '大宗修改';
|
||||
} else if (this.route.snapshot?.queryParams?.sta === '4') {
|
||||
this.PageStatus = '大宗下一单';
|
||||
}
|
||||
this.initSF1();
|
||||
this.initSF3();
|
||||
@ -116,7 +103,6 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
this.initSF7();
|
||||
this.initdata();
|
||||
}
|
||||
|
||||
initSF1() {
|
||||
this.schema1 = {
|
||||
properties: {
|
||||
@ -141,7 +127,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
},
|
||||
change: (q: any) => {
|
||||
this.getRegionCode(q);
|
||||
},
|
||||
}
|
||||
} as SFSelectWidgetSchema
|
||||
},
|
||||
enterpriseProjectId: {
|
||||
@ -149,7 +135,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
title: '项目',
|
||||
ui: {
|
||||
widget: 'select',
|
||||
placeholder: '请选择',
|
||||
placeholder: '请选择'
|
||||
} as SFSelectWidgetSchema
|
||||
},
|
||||
enterpriseInfoName: {
|
||||
@ -193,9 +179,9 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
placeholder: '请选择',
|
||||
allowClear: true,
|
||||
optionalHelp: '选择调度员,司机直接联系调度员 ; 不选择,司机直接联系您',
|
||||
change: (value: any, data: any) => {
|
||||
change: (_value: any, data: any) => {
|
||||
if (data.label) {
|
||||
const dat = data.label.split('/')
|
||||
const dat = data.label.split('/');
|
||||
this.sf1.setValue('/dispatchName', dat[0]);
|
||||
this.sf1.setValue('/dispatchPhone', dat[1]);
|
||||
}
|
||||
@ -251,7 +237,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
widget: 'select',
|
||||
placeholder: '请选择',
|
||||
errors: { required: '请填写货物名称' },
|
||||
change: (value: any, data: any) => {
|
||||
change: (_value: any, data: any) => {
|
||||
this.sf3.setValue('/goodsName', data.label);
|
||||
},
|
||||
visibleIf: {
|
||||
@ -364,30 +350,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
}
|
||||
};
|
||||
}
|
||||
// 获取城市列表
|
||||
getRegionCode(regionCode: any) {
|
||||
console.log(regionCode);
|
||||
return this.service
|
||||
.request(this.service.$api_get_enterprise_project, { id: regionCode })
|
||||
.pipe(
|
||||
map(res =>
|
||||
res.map((item: any) => ({
|
||||
label: item.projectName,
|
||||
value: item.id
|
||||
}))
|
||||
)
|
||||
)
|
||||
.subscribe(res => {
|
||||
this.sf1.getProperty('/enterpriseProjectId')!.schema.enum = res;
|
||||
this.sf1.getProperty('/enterpriseProjectId')!.widget.reset(res);
|
||||
console.log('12345645454545454=============')
|
||||
console.log(this.enterpriseProjectIds)
|
||||
console.log(res)
|
||||
if(this.enterpriseProjectIds) {
|
||||
this.sf1.setValue('/enterpriseProjectId', this.enterpriseProjectIds);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
initSF5() {
|
||||
this.schema5 = {
|
||||
properties: {
|
||||
@ -409,7 +372,6 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
initSF6() {
|
||||
this.schema6 = {
|
||||
properties: {
|
||||
@ -504,7 +466,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
} as SFTextareaWidgetSchema
|
||||
}
|
||||
},
|
||||
required: ['stateReceipt', 'receiptType', 'receiptAddressId',]
|
||||
required: ['stateReceipt', 'receiptType', 'receiptAddressId']
|
||||
};
|
||||
this.ui6 = {
|
||||
'*': {
|
||||
@ -513,15 +475,6 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
}
|
||||
};
|
||||
}
|
||||
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: {
|
||||
@ -532,7 +485,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
default: 0,
|
||||
ui: {
|
||||
prefix: '¥',
|
||||
change: args => this.payChange()
|
||||
change: _args => this.payChange()
|
||||
} as SFNumberWidgetSchema
|
||||
},
|
||||
toPay: {
|
||||
@ -540,21 +493,21 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
title: '到付',
|
||||
minimum: 0,
|
||||
default: 0,
|
||||
ui: { prefix: '¥', change: args => this.payChange() } as SFNumberWidgetSchema
|
||||
ui: { prefix: '¥', change: _args => this.payChange() } as SFNumberWidgetSchema
|
||||
},
|
||||
oilCardPay: {
|
||||
type: 'number',
|
||||
title: '油卡',
|
||||
minimum: 0,
|
||||
default: 0,
|
||||
ui: { prefix: '¥', change: args => this.payChange() } as SFNumberWidgetSchema
|
||||
ui: { prefix: '¥', change: _args => this.payChange() } as SFNumberWidgetSchema
|
||||
},
|
||||
receiptPay: {
|
||||
type: 'number',
|
||||
title: '回单付',
|
||||
minimum: 0,
|
||||
default: 0,
|
||||
ui: { prefix: '¥', change: args => this.payChange() } as SFNumberWidgetSchema
|
||||
ui: { prefix: '¥', change: _args => this.payChange() } as SFNumberWidgetSchema
|
||||
},
|
||||
subtotal: { type: 'number', title: '小计', default: 0, ui: { widget: 'custom' } as SFNumberWidgetSchema },
|
||||
appendFee: { type: 'number', title: '附加费', default: 0, ui: { widget: 'custom' } as SFNumberWidgetSchema },
|
||||
@ -578,24 +531,61 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
}
|
||||
};
|
||||
}
|
||||
// 获取城市列表
|
||||
getRegionCode(regionCode: any) {
|
||||
console.log(regionCode);
|
||||
return this.service
|
||||
.request(this.service.$api_get_enterprise_project, { id: regionCode })
|
||||
.pipe(
|
||||
map(res =>
|
||||
res.map((item: any) => ({
|
||||
label: item.projectName,
|
||||
value: item.id
|
||||
}))
|
||||
)
|
||||
)
|
||||
.subscribe(res => {
|
||||
this.sf1.getProperty('/enterpriseProjectId')!.schema.enum = res;
|
||||
this.sf1.getProperty('/enterpriseProjectId')!.widget.reset(res);
|
||||
console.log('12345645454545454=============');
|
||||
console.log(this.enterpriseProjectIds);
|
||||
console.log(res);
|
||||
if (this.enterpriseProjectIds) {
|
||||
this.sf1.setValue('/enterpriseProjectId', this.enterpriseProjectIds);
|
||||
}
|
||||
});
|
||||
}
|
||||
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);
|
||||
}
|
||||
payChange(value?: any) {
|
||||
let subtotal: any ={}
|
||||
let oilCardPay: any ={}
|
||||
let subtotal: any = {};
|
||||
let oilCardPay: any = {};
|
||||
if (value) {
|
||||
subtotal = (value.prePay +value.toPay + value.oilCardPay + value.receiptPay) || 0;
|
||||
subtotal = value.prePay + value.toPay + value.oilCardPay + value.receiptPay || 0;
|
||||
oilCardPay = value.oilCardPay || 0;
|
||||
} else {
|
||||
subtotal = (this.sf7.value.prePay + this.sf7.value.toPay + this.sf7.value.oilCardPay + this.sf7.value.receiptPay) || 0;
|
||||
subtotal = this.sf7.value.prePay + this.sf7.value.toPay + this.sf7.value.oilCardPay + this.sf7.value.receiptPay || 0;
|
||||
oilCardPay = this.sf7.value.oilCardPay || 0;
|
||||
}
|
||||
console.log(this.sf7.value)
|
||||
console.log(this.sf7.value);
|
||||
|
||||
this.service.request(this.service.$api_getCalculatedSurcharge + `?totalFreight=${subtotal}&fuelCardAmount=${oilCardPay}`).subscribe(res => {
|
||||
this.service
|
||||
.request(this.service.$api_getCalculatedSurcharge + `?totalFreight=${subtotal}&fuelCardAmount=${oilCardPay}`)
|
||||
.subscribe(res => {
|
||||
if (res) {
|
||||
this.sf7.setValue('/appendFee', res.surcharge);
|
||||
this.sf7.setValue('/subtotal', subtotal);
|
||||
this.sf7.setValue('/total', subtotal + res.surcharge);
|
||||
this.service.request(this.service.$api_getcalculatedServiceRate + `?invoiceAmount=${subtotal + res.surcharge}&totalFreight=${subtotal}`).subscribe(res => {
|
||||
this.service
|
||||
.request(this.service.$api_getcalculatedServiceRate + `?invoiceAmount=${subtotal + res.surcharge}&totalFreight=${subtotal}`)
|
||||
.subscribe(res => {
|
||||
if (res) {
|
||||
this.currentRate = res.rate * 100;
|
||||
} else {
|
||||
@ -606,10 +596,9 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
this.service.msgSrv.error(res.msg);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
addStartInfo(event: any) {
|
||||
// 添加 删除发货卸货地址
|
||||
addStartInfo(_event: any) {
|
||||
if (this.startInfo.length < 5) {
|
||||
const controlId = this.startInfo.length;
|
||||
this.startInfo.push({
|
||||
@ -628,6 +617,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
this.validateForm1.addControl(`loadPhone${controlId}`, new FormControl(null, Validators.required));
|
||||
}
|
||||
}
|
||||
// 添加 删除发货卸货地址
|
||||
subStartInfo(event: any, index: number, id?: any) {
|
||||
console.log(event, index, id);
|
||||
if (id) {
|
||||
@ -640,6 +630,39 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
this.validateForm1.removeControl(`loadName${index}`);
|
||||
this.validateForm1.removeControl(`loadPhone${index}`);
|
||||
}
|
||||
// 添加 删除发货卸货地址
|
||||
addEndInfo(_event: any) {
|
||||
if (this.addEndInfo.length < 5) {
|
||||
const controlId = this.endInfo.length;
|
||||
this.endInfo.push({
|
||||
detailedAddress: '',
|
||||
appUserName: '',
|
||||
contractTelephone: '',
|
||||
latitude: '',
|
||||
longitude: '',
|
||||
province: '',
|
||||
city: '',
|
||||
area: '',
|
||||
type: 2
|
||||
});
|
||||
this.validateForm1.addControl(`unloadAddress${controlId}`, new FormControl(null, Validators.required));
|
||||
this.validateForm1.addControl(`unloadName${controlId}`, new FormControl(null, Validators.required));
|
||||
this.validateForm1.addControl(`unloadPhone${controlId}`, new FormControl(null, Validators.required));
|
||||
}
|
||||
}
|
||||
// 添加 删除发货卸货地址
|
||||
subEndInfo(event: any, index: number, id?: any) {
|
||||
if (id) {
|
||||
this.service.request(this.service.$api_delete_Wholedeletebatch, [id]).subscribe(res => {
|
||||
console.log(res);
|
||||
});
|
||||
}
|
||||
console.log(event, index, id);
|
||||
this.endInfo.splice(index, 1);
|
||||
this.validateForm1.removeControl(`unloadAddress${index}`);
|
||||
this.validateForm1.removeControl(`unloadName${index}`);
|
||||
this.validateForm1.removeControl(`unloadPhone${index}`);
|
||||
}
|
||||
changeGoodsType(value: string, data: any) {
|
||||
if (data.label === '其它') return;
|
||||
const params = {
|
||||
@ -668,42 +691,9 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
addEndInfo(event: any) {
|
||||
if (this.addEndInfo.length < 5) {
|
||||
const controlId = this.endInfo.length;
|
||||
this.endInfo.push({
|
||||
detailedAddress: '',
|
||||
appUserName: '',
|
||||
contractTelephone: '',
|
||||
latitude: '',
|
||||
longitude: '',
|
||||
province: '',
|
||||
city: '',
|
||||
area: '',
|
||||
type: 2
|
||||
});
|
||||
this.validateForm1.addControl(`unloadAddress${controlId}`, new FormControl(null, Validators.required));
|
||||
this.validateForm1.addControl(`unloadName${controlId}`, new FormControl(null, Validators.required));
|
||||
this.validateForm1.addControl(`unloadPhone${controlId}`, new FormControl(null, Validators.required));
|
||||
}
|
||||
}
|
||||
subEndInfo(event: any, index: number, id?: any) {
|
||||
if (id) {
|
||||
this.service.request(this.service.$api_delete_Wholedeletebatch, [id]).subscribe(res => {
|
||||
console.log(res);
|
||||
});
|
||||
}
|
||||
console.log(event, index, id);
|
||||
this.endInfo.splice(index, 1);
|
||||
this.validateForm1.removeControl(`unloadAddress${index}`);
|
||||
this.validateForm1.removeControl(`unloadName${index}`);
|
||||
this.validateForm1.removeControl(`unloadPhone${index}`);
|
||||
}
|
||||
|
||||
//指派熟车
|
||||
chooseFamifiar(item: any) {
|
||||
console.log('999')
|
||||
console.log('999');
|
||||
const modalRef = this.modalService.create({
|
||||
nzTitle: '指派熟车',
|
||||
nzContent: SupplyManagementVehicleAssignedCarComponent,
|
||||
@ -713,7 +703,6 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
url: this.service.$api_save_assign_whole,
|
||||
params: item,
|
||||
type: 'next'
|
||||
|
||||
},
|
||||
nzFooter: null
|
||||
});
|
||||
@ -748,6 +737,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
// 提交
|
||||
submit(submitType?: string): void {
|
||||
Object.keys(this.validateForm1.controls).forEach(key => {
|
||||
this.validateForm1.controls[key].markAsDirty();
|
||||
@ -758,7 +748,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
this.sf4.validator({ emitError: true });
|
||||
this.sf6.validator({ emitError: true });
|
||||
this.sf7.validator({ emitError: true });
|
||||
console.log(this.sf1.valid)
|
||||
console.log(this.sf1.valid);
|
||||
if (this.validateForm1.invalid || !this.sf3.valid || !this.sf1.valid || !this.sf4.valid || !this.sf6.valid || !this.sf7.valid) {
|
||||
return;
|
||||
}
|
||||
@ -833,6 +823,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
return num;
|
||||
}
|
||||
}
|
||||
// 下单成功提示弹窗
|
||||
requests(url: any, params: any) {
|
||||
this.service.request(url, params).subscribe((res: any) => {
|
||||
if (res) {
|
||||
@ -889,21 +880,18 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
// 返回上一页
|
||||
goBack() {
|
||||
window.history.go(-1);
|
||||
}
|
||||
// 初始化信息
|
||||
// 初始化赋值信息
|
||||
initdata() {
|
||||
this.service.request(`${this.service.$api_get_getCompleteVehicleDetail}`, { id: this.id }).subscribe(res => {
|
||||
this.dataR(res);
|
||||
});
|
||||
}
|
||||
asds(i: any) {
|
||||
console.log(i);
|
||||
}
|
||||
// 初始化信息
|
||||
// 初始化赋值信息函数
|
||||
dataR(res: any) {
|
||||
// this.dataList = res;
|
||||
if (res?.shipperAppUserName) {
|
||||
const List: any = [];
|
||||
this.service.request(this.service.$api_enterpriceList, { enterpriseName: res?.shipperAppUserName }).subscribe(rs => {
|
||||
@ -919,7 +907,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
if (res?.enterpriseProjectId) {
|
||||
this.enterpriseProjectIds = res.enterpriseProjectId
|
||||
this.enterpriseProjectIds = res.enterpriseProjectId;
|
||||
}
|
||||
this.sf1data = {
|
||||
enterpriseInfoName: res?.enterpriseInfoName,
|
||||
@ -1002,7 +990,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
goodsTypeId: res?.goodsInfoVOList[0]?.goodsTypeId || '',
|
||||
goodsTypeName: res?.goodsInfoVOList[0]?.goodsTypeName || '',
|
||||
goodsNameId: res?.goodsInfoVOList[0]?.goodsNameId || '',
|
||||
goodsName: res?.goodsInfoVOList[0]?.goodsName || '',
|
||||
goodsName: res?.goodsInfoVOList[0]?.goodsName || ''
|
||||
};
|
||||
if (this.sf3data.goodsTypeName === '其它') {
|
||||
this.sf3data.goodsName1 = res?.goodsInfoVOList[0]?.goodsName || '';
|
||||
@ -1049,7 +1037,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
area: res?.supplementaryInformationVO?.area || '',
|
||||
phon: res?.supplementaryInformationVO?.phon || '',
|
||||
address: res?.supplementaryInformationVO?.address || '',
|
||||
remarks: res?.supplementaryInformationVO?.remarks || '',
|
||||
remarks: res?.supplementaryInformationVO?.remarks || ''
|
||||
};
|
||||
// if (this.PageStatus === '整车修改') {
|
||||
// this.sf6data.id = res?.supplementaryInformationVO?.id
|
||||
@ -1066,6 +1054,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
};
|
||||
this.payChange(this.sf7data);
|
||||
}
|
||||
// 选择收回单地址
|
||||
backBillChange() {
|
||||
const modalRef = this.modalService.create({
|
||||
nzTitle: '选择收回单地址',
|
||||
@ -1083,9 +1072,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
choose(){
|
||||
window.history.go(-1);
|
||||
}
|
||||
// 选择地址
|
||||
chooseAddress(index: number, type: string) {
|
||||
const modalRef = this.modalService.create({
|
||||
nzTitle: '选择地址',
|
||||
@ -1093,8 +1080,8 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
nzWidth: 900,
|
||||
nzComponentParams: { spuStatus: '1' },
|
||||
nzOnOk: item => {
|
||||
console.log(item)
|
||||
console.log(type)
|
||||
console.log(item);
|
||||
console.log(type);
|
||||
const data = item.seleteData;
|
||||
if (JSON.stringify(data) === '{}') return;
|
||||
switch (type) {
|
||||
@ -1130,5 +1117,4 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -324,6 +324,6 @@
|
||||
[nzLoading]="service.http.loading"
|
||||
>保存</button
|
||||
>
|
||||
<button nz-button nzType="primary" style="margin-left: 48px" (click)="close()" *ngIf="type === 'edit'">取消</button>
|
||||
<button nz-button nzType="primary" style="margin-left: 48px" (click)="goBack()" *ngIf="type === 'edit'">取消</button>
|
||||
</div>
|
||||
</nz-card>
|
||||
|
||||
@ -3,7 +3,6 @@ import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { cacheConf } from '@conf/cache.conf';
|
||||
import {
|
||||
SFArrayWidgetSchema,
|
||||
SFComponent,
|
||||
SFNumberWidgetSchema,
|
||||
SFSchema,
|
||||
@ -15,10 +14,9 @@ import {
|
||||
import { SettingsService, _HttpClient } from '@delon/theme';
|
||||
import { EACacheService, ShipperBaseService } from '@shared';
|
||||
import format from 'date-fns/format';
|
||||
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { of } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
|
||||
import { AmapPoiPickerComponent, AmapService } from 'src/app/shared/components/amap';
|
||||
import { SupplyManagementService } from '../../services/supply-management.service';
|
||||
import { SupplyManagementVehicleAssignedCarComponent } from '../assigned-car/assigned-car.component';
|
||||
@ -34,7 +32,6 @@ import { TranAgreementComponent } from '../tran-agreement/tran-agreement.compone
|
||||
export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
// 环境信息 appId、tenantId
|
||||
envInfo = this.eaCacheSrv.get(cacheConf.env);
|
||||
|
||||
validateForm1: FormGroup;
|
||||
sf1data: any; // 货源单设置回显
|
||||
sf3data: any; // 货源单设置回显
|
||||
@ -42,26 +39,14 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
sf5data: any; // 货源单设置回显
|
||||
sf6data: any; // 货源单设置回显
|
||||
sf7data: any; // 货源单设置回显
|
||||
creatTime: any; // 货源单设置回显
|
||||
modifyTime: any; // 货源单设置回显
|
||||
totalFees: any; // 总数信息
|
||||
id = '';
|
||||
type = 'add';
|
||||
|
||||
// // 单位
|
||||
unit1 = '吨';
|
||||
unit2 = '方';
|
||||
unit3 = '保价费金额';
|
||||
startInfo: any[] = [];
|
||||
endInfo: any[] = [];
|
||||
totalDistance = 0.0; //总里程
|
||||
totalTime = 0.0; //路程总时间
|
||||
|
||||
currentGoodsTypeName: any;
|
||||
currentRate = 0 //实时计算的费率
|
||||
|
||||
// formatterRmb = (value: number): string => `¥ ${value}`;
|
||||
// parserRmb = (value: string): string => value.replace('¥ ', '');
|
||||
currentRate = 0; //实时计算的费率
|
||||
constructor(
|
||||
private http: _HttpClient,
|
||||
fb: FormBuilder,
|
||||
@ -103,6 +88,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
@ViewChild('sf7', { static: false }) sf7!: SFComponent;
|
||||
schema7: SFSchema = {};
|
||||
ui7!: SFUISchema;
|
||||
// 页面初始化
|
||||
ngOnInit(): void {
|
||||
this.initSF1();
|
||||
this.initSF3();
|
||||
@ -113,7 +99,6 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
this.addStartInfo();
|
||||
this.addEndInfo();
|
||||
}
|
||||
|
||||
initSF1() {
|
||||
this.schema1 = {
|
||||
properties: {
|
||||
@ -130,19 +115,19 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
if (!!q) {
|
||||
return this.service
|
||||
.request(this.service.$api_enterpriceList, { enterpriseName: q })
|
||||
.pipe(map((res) => (res as any[]).map((i) => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum))))
|
||||
.pipe(map(res => (res as any[]).map(i => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum))))
|
||||
.toPromise();
|
||||
} else {
|
||||
return of([]);
|
||||
}
|
||||
},
|
||||
change: (q: any) => {
|
||||
this.getRegionCode(q)
|
||||
this.getRegionCode(q);
|
||||
},
|
||||
visibleIf: {
|
||||
_$expand: (value: boolean) => value,
|
||||
},
|
||||
} as SFSelectWidgetSchema,
|
||||
_$expand: (value: boolean) => value
|
||||
}
|
||||
} as SFSelectWidgetSchema
|
||||
},
|
||||
enterpriseProjectId: {
|
||||
type: 'string',
|
||||
@ -150,7 +135,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
ui: {
|
||||
widget: 'select',
|
||||
placeholder: '请选择',
|
||||
allowClear: true,
|
||||
allowClear: true
|
||||
} as SFSelectWidgetSchema
|
||||
},
|
||||
// enterpriseInfoName: {
|
||||
@ -168,11 +153,11 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
widget: 'select',
|
||||
placeholder: '请选择',
|
||||
visibleIf: {
|
||||
_$expand: (value: boolean) => value,
|
||||
_$expand: (value: boolean) => value
|
||||
},
|
||||
allowClear: true,
|
||||
asyncData: () => this.shipperSrv.getNetworkFreightForwarder(),
|
||||
},
|
||||
asyncData: () => this.shipperSrv.getNetworkFreightForwarder()
|
||||
}
|
||||
},
|
||||
externalResourceCode: {
|
||||
type: 'string',
|
||||
@ -207,9 +192,9 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
widget: 'select',
|
||||
placeholder: '请选择',
|
||||
allowClear: true,
|
||||
change: (value: any, data: any) => {
|
||||
change: (_value: any, data: any) => {
|
||||
if (data.label) {
|
||||
const dat = data.label.split('/')
|
||||
const dat = data.label.split('/');
|
||||
this.sf1.setValue('/dispatchName', dat[0]);
|
||||
this.sf1.setValue('/dispatchPhone', dat[1]);
|
||||
}
|
||||
@ -231,24 +216,6 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
}
|
||||
};
|
||||
}
|
||||
// 获取城市列表
|
||||
getRegionCode(regionCode: any) {
|
||||
console.log(regionCode)
|
||||
return this.service
|
||||
.request(this.service.$api_get_enterprise_project, { id: regionCode })
|
||||
.pipe(
|
||||
map((res) =>
|
||||
res.map((item: any) => ({
|
||||
label: item.projectName,
|
||||
value: item.id,
|
||||
})),
|
||||
),
|
||||
)
|
||||
.subscribe((res) => {
|
||||
this.sf1.getProperty('/enterpriseProjectId')!.schema.enum = res;
|
||||
this.sf1.getProperty('/enterpriseProjectId')!.widget.reset(res);
|
||||
});
|
||||
}
|
||||
initSF3() {
|
||||
this.schema3 = {
|
||||
properties: {
|
||||
@ -287,7 +254,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
widget: 'select',
|
||||
placeholder: '请选择',
|
||||
errors: { required: '请填写货物名称' },
|
||||
change: (value: any, data: any) => {
|
||||
change: (_value: any, data: any) => {
|
||||
this.sf3.setValue('/goodsName', data.label);
|
||||
},
|
||||
visibleIf: {
|
||||
@ -400,7 +367,6 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
initSF5() {
|
||||
this.schema5 = {
|
||||
properties: {
|
||||
@ -420,7 +386,6 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
initSF6() {
|
||||
this.schema6 = {
|
||||
properties: {
|
||||
@ -524,7 +489,6 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
initSF7() {
|
||||
this.schema7 = {
|
||||
properties: {
|
||||
@ -535,7 +499,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
minimum: 0,
|
||||
ui: {
|
||||
prefix: '¥',
|
||||
change: args => this.payChange()
|
||||
change: _args => this.payChange()
|
||||
} as SFNumberWidgetSchema
|
||||
},
|
||||
toPay: {
|
||||
@ -543,21 +507,21 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
title: '到付',
|
||||
minimum: 0,
|
||||
default: 0,
|
||||
ui: { prefix: '¥', change: args => this.payChange() } as SFNumberWidgetSchema
|
||||
ui: { prefix: '¥', change: _args => this.payChange() } as SFNumberWidgetSchema
|
||||
},
|
||||
oilCardPay: {
|
||||
type: 'number',
|
||||
title: '油卡',
|
||||
minimum: 0,
|
||||
default: 0,
|
||||
ui: { prefix: '¥', change: args => this.payChange() } as SFNumberWidgetSchema
|
||||
ui: { prefix: '¥', change: _args => this.payChange() } as SFNumberWidgetSchema
|
||||
},
|
||||
receiptPay: {
|
||||
type: 'number',
|
||||
title: '回单付',
|
||||
minimum: 0,
|
||||
default: 0,
|
||||
ui: { prefix: '¥', change: args => this.payChange() } as SFNumberWidgetSchema
|
||||
ui: { prefix: '¥', change: _args => this.payChange() } as SFNumberWidgetSchema
|
||||
},
|
||||
subtotal: { type: 'number', title: '小计', default: 0, ui: { widget: 'custom' } as SFNumberWidgetSchema },
|
||||
appendFee: { type: 'number', title: '附加费', default: 0, ui: { widget: 'custom' } as SFNumberWidgetSchema },
|
||||
@ -581,16 +545,37 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// 获取城市列表
|
||||
getRegionCode(regionCode: any) {
|
||||
console.log(regionCode);
|
||||
return this.service
|
||||
.request(this.service.$api_get_enterprise_project, { id: regionCode })
|
||||
.pipe(
|
||||
map(res =>
|
||||
res.map((item: any) => ({
|
||||
label: item.projectName,
|
||||
value: item.id
|
||||
}))
|
||||
)
|
||||
)
|
||||
.subscribe(res => {
|
||||
this.sf1.getProperty('/enterpriseProjectId')!.schema.enum = res;
|
||||
this.sf1.getProperty('/enterpriseProjectId')!.widget.reset(res);
|
||||
});
|
||||
}
|
||||
payChange() {
|
||||
const subtotal = (this.sf7.value.prePay + this.sf7.value.toPay + this.sf7.value.oilCardPay + this.sf7.value.receiptPay) || 0;
|
||||
const subtotal = this.sf7.value.prePay + this.sf7.value.toPay + this.sf7.value.oilCardPay + this.sf7.value.receiptPay || 0;
|
||||
const oilCardPay = this.sf7.value.oilCardPay || 0;
|
||||
this.service.request(this.service.$api_getCalculatedSurcharge+`?totalFreight=${subtotal}&fuelCardAmount=${oilCardPay}`).subscribe((res: any) => {
|
||||
this.service
|
||||
.request(this.service.$api_getCalculatedSurcharge + `?totalFreight=${subtotal}&fuelCardAmount=${oilCardPay}`)
|
||||
.subscribe((res: any) => {
|
||||
if (res) {
|
||||
this.sf7.setValue('/appendFee', res.surcharge);
|
||||
this.sf7.setValue('/subtotal', subtotal);
|
||||
this.sf7.setValue('/total', subtotal + res.surcharge);
|
||||
this.service.request(this.service.$api_getcalculatedServiceRate+`?invoiceAmount=${subtotal+res.surcharge}&totalFreight=${subtotal}`).subscribe((res: any) => {
|
||||
this.service
|
||||
.request(this.service.$api_getcalculatedServiceRate + `?invoiceAmount=${subtotal + res.surcharge}&totalFreight=${subtotal}`)
|
||||
.subscribe((res: any) => {
|
||||
if (res) {
|
||||
this.currentRate = res.rate;
|
||||
} else {
|
||||
@ -601,9 +586,8 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
this.service.msgSrv.error(res.msg);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// 添加 删除发货卸货地址
|
||||
addStartInfo() {
|
||||
if (this.startInfo.length < 5) {
|
||||
const controlId = this.startInfo.length;
|
||||
@ -623,13 +607,14 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
this.validateForm1.addControl(`loadPhone${controlId}`, new FormControl(null, Validators.required));
|
||||
}
|
||||
}
|
||||
subStartInfo(event: any, index: number) {
|
||||
// 添加 删除发货卸货地址
|
||||
subStartInfo(_event: any, index: number) {
|
||||
this.startInfo.splice(index, 1);
|
||||
this.validateForm1.removeControl(`loadAddress${index}`);
|
||||
this.validateForm1.removeControl(`loadName${index}`);
|
||||
this.validateForm1.removeControl(`loadPhone${index}`);
|
||||
}
|
||||
|
||||
// 添加 删除发货卸货地址
|
||||
addEndInfo() {
|
||||
if (this.addEndInfo.length < 5) {
|
||||
const controlId = this.endInfo.length;
|
||||
@ -649,16 +634,16 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
this.validateForm1.addControl(`unloadPhone${controlId}`, new FormControl(null, Validators.required));
|
||||
}
|
||||
}
|
||||
subEndInfo(event: any, index: number) {
|
||||
// 添加 删除发货卸货地址
|
||||
subEndInfo(_event: any, index: number) {
|
||||
this.endInfo.splice(index, 1);
|
||||
this.validateForm1.removeControl(`unloadAddress${index}`);
|
||||
this.validateForm1.removeControl(`unloadName${index}`);
|
||||
this.validateForm1.removeControl(`unloadPhone${index}`);
|
||||
}
|
||||
|
||||
//指派熟车
|
||||
chooseFamifiar(item: any) {
|
||||
console.log('999')
|
||||
console.log('999');
|
||||
const modalRef = this.modalService.create({
|
||||
nzTitle: '指派熟车',
|
||||
nzContent: SupplyManagementVehicleAssignedCarComponent,
|
||||
@ -690,6 +675,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
// 提交
|
||||
submit(submitType: string): void {
|
||||
Object.keys(this.validateForm1.controls).forEach(key => {
|
||||
this.validateForm1.controls[key].markAsDirty();
|
||||
@ -761,7 +747,6 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 打开地图
|
||||
openMap(type: string, index: number) {
|
||||
const modalRef = this.modalService.create({
|
||||
@ -801,7 +786,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 选择收回单地址
|
||||
backBillChange() {
|
||||
const modalRef = this.modalService.create({
|
||||
nzTitle: '选择收回单地址',
|
||||
@ -819,7 +804,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 选择地址
|
||||
chooseAddress(index: number, type: string) {
|
||||
const modalRef = this.modalService.create({
|
||||
nzTitle: '选择地址',
|
||||
@ -827,8 +812,8 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
nzWidth: 900,
|
||||
nzComponentParams: { spuStatus: '1' },
|
||||
nzOnOk: item => {
|
||||
console.log(item)
|
||||
console.log(type)
|
||||
console.log(item);
|
||||
console.log(type);
|
||||
const data = item.seleteData;
|
||||
if (JSON.stringify(data) === '{}') return;
|
||||
switch (type) {
|
||||
@ -864,9 +849,6 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 打开下单完成页面
|
||||
openFinishPage(resourceObj: any = null) {
|
||||
this.modalService.create({
|
||||
@ -905,12 +887,7 @@ export class SupplyManagementReleasePublishComponent implements OnInit {
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
* 取消
|
||||
*/
|
||||
close() {
|
||||
window.history.go(-1);
|
||||
}
|
||||
// 返回上一页
|
||||
goBack() {
|
||||
window.history.go(-1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user