Merge branch 'develop' of https://gitlab.eascs.com/tms-ui/tms-obc-web into develop
This commit is contained in:
@ -26,7 +26,6 @@ import { PublishAddressListComponent } from '../onecar-publish/address-list/addr
|
|||||||
})
|
})
|
||||||
export class SupplyManagementBulkPublishComponent implements OnInit {
|
export class SupplyManagementBulkPublishComponent implements OnInit {
|
||||||
validateForm1: FormGroup;
|
validateForm1: FormGroup;
|
||||||
newTempchecked = false; //是否存入新模板
|
|
||||||
sf1data: any; // 货源单设置回显
|
sf1data: any; // 货源单设置回显
|
||||||
sf3data: any; // 货源单设置回显
|
sf3data: any; // 货源单设置回显
|
||||||
sf4data: any; // 货源单设置回显
|
sf4data: any; // 货源单设置回显
|
||||||
@ -39,24 +38,20 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
|||||||
totalTime = 0.0; //路程总时间
|
totalTime = 0.0; //路程总时间
|
||||||
currentGoodsTypeName: any;
|
currentGoodsTypeName: any;
|
||||||
enterpriseProjectIds: any;
|
enterpriseProjectIds: any;
|
||||||
id = this.route.snapshot.params.id;
|
id = this.route.snapshot.params.id; // 传参id
|
||||||
// // 单位
|
// // 单位
|
||||||
unit1 = '吨';
|
|
||||||
unit2 = '方';
|
|
||||||
unit3 = '保价费金额';
|
|
||||||
startInfo: any = [];
|
startInfo: any = [];
|
||||||
endInfo: any = [];
|
endInfo: any = [];
|
||||||
PageStatus = '';
|
PageStatus = '';
|
||||||
dataList: any;
|
|
||||||
constructor(
|
constructor(
|
||||||
private http: _HttpClient,
|
private http: _HttpClient,
|
||||||
fb: FormBuilder,
|
fb: FormBuilder,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private modalService: NzModalService,
|
private modalService: NzModalService,
|
||||||
public service: SupplyManagementService,
|
public service: SupplyManagementService,
|
||||||
private amapService: AmapService,
|
private amapService: AmapService,
|
||||||
public shipperSrv: ShipperBaseService,) {
|
public shipperSrv: ShipperBaseService,) {
|
||||||
this.validateForm1 = fb.group({
|
this.validateForm1 = fb.group({
|
||||||
createTime: [null, []],
|
createTime: [null, []],
|
||||||
modifyTime: [null, []],
|
modifyTime: [null, []],
|
||||||
@ -84,17 +79,12 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
|||||||
schema4: SFSchema = {};
|
schema4: SFSchema = {};
|
||||||
ui4!: SFUISchema;
|
ui4!: SFUISchema;
|
||||||
|
|
||||||
|
|
||||||
@ViewChild('sf7', { static: false }) sf7!: SFComponent;
|
@ViewChild('sf7', { static: false }) sf7!: SFComponent;
|
||||||
schema7: SFSchema = {};
|
schema7: SFSchema = {};
|
||||||
ui7!: SFUISchema;
|
ui7!: SFUISchema;
|
||||||
|
// 初始化
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
if(this.route.snapshot?.queryParams?.sta === '1') {
|
if(this.route.snapshot?.queryParams?.sta === '3') {
|
||||||
console.log('修改')
|
|
||||||
this.PageStatus = '整车修改';
|
|
||||||
} else if(this.route.snapshot?.queryParams?.sta === '2') {
|
|
||||||
this.PageStatus = '整车下一单';
|
|
||||||
} else if(this.route.snapshot?.queryParams?.sta === '3') {
|
|
||||||
this.PageStatus = '大宗修改';
|
this.PageStatus = '大宗修改';
|
||||||
} else if(this.route.snapshot?.queryParams?.sta === '4') {
|
} else if(this.route.snapshot?.queryParams?.sta === '4') {
|
||||||
this.PageStatus = '大宗下一单';
|
this.PageStatus = '大宗下一单';
|
||||||
@ -105,9 +95,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
|||||||
this.initSF6();
|
this.initSF6();
|
||||||
this.initdata();
|
this.initdata();
|
||||||
}
|
}
|
||||||
|
|
||||||
initSF1() {
|
initSF1() {
|
||||||
|
|
||||||
this.schema1 = {
|
this.schema1 = {
|
||||||
properties: {
|
properties: {
|
||||||
shipperAppUserId: {
|
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() {
|
initSF3() {
|
||||||
this.schema3 = {
|
this.schema3 = {
|
||||||
properties: {
|
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() {
|
initSF6() {
|
||||||
this.schema7 = {
|
this.schema7 = {
|
||||||
properties: {
|
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) {
|
addStartInfo(event: any) {
|
||||||
if (this.startInfo.length < 5) {
|
if (this.startInfo.length < 5) {
|
||||||
const controlId = this.startInfo.length;
|
const controlId = this.startInfo.length;
|
||||||
@ -567,10 +549,8 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
subStartInfo(event: any, index: number, id?:any) {
|
subStartInfo(event: any, index: number, id?:any) {
|
||||||
console.log(event, index, id)
|
|
||||||
if(id) {
|
if(id) {
|
||||||
this.service.request(this.service.$api_delete_Wholedeletebatch, [id]).subscribe((res) => {
|
this.service.request(this.service.$api_delete_Wholedeletebatch, [id]).subscribe((res) => {
|
||||||
console.log(res)
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.startInfo.splice(index, 1);
|
this.startInfo.splice(index, 1);
|
||||||
@ -578,7 +558,6 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
|||||||
this.validateForm1.removeControl(`loadName${index}`);
|
this.validateForm1.removeControl(`loadName${index}`);
|
||||||
this.validateForm1.removeControl(`loadPhone${index}`);
|
this.validateForm1.removeControl(`loadPhone${index}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
addEndInfo(event: any) {
|
addEndInfo(event: any) {
|
||||||
if (this.addEndInfo.length < 5) {
|
if (this.addEndInfo.length < 5) {
|
||||||
const controlId = this.endInfo.length;
|
const controlId = this.endInfo.length;
|
||||||
@ -601,18 +580,14 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
|||||||
subEndInfo(event: any, index: number, id?:any) {
|
subEndInfo(event: any, index: number, id?:any) {
|
||||||
if(id) {
|
if(id) {
|
||||||
this.service.request(this.service.$api_delete_Wholedeletebatch, [id]).subscribe((res) => {
|
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.endInfo.splice(index, 1);
|
||||||
this.validateForm1.removeControl(`unloadAddress${index}`);
|
this.validateForm1.removeControl(`unloadAddress${index}`);
|
||||||
this.validateForm1.removeControl(`unloadName${index}`);
|
this.validateForm1.removeControl(`unloadName${index}`);
|
||||||
this.validateForm1.removeControl(`unloadPhone${index}`);
|
this.validateForm1.removeControl(`unloadPhone${index}`);
|
||||||
}
|
}
|
||||||
|
// 指派熟车
|
||||||
//指派熟车
|
|
||||||
//指派熟车
|
|
||||||
chooseFamifiar(item: any) {
|
chooseFamifiar(item: any) {
|
||||||
const modalRef = this.modalService.create({
|
const modalRef = this.modalService.create({
|
||||||
nzTitle: '指派熟车',
|
nzTitle: '指派熟车',
|
||||||
@ -629,8 +604,8 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 打开下单完成页面
|
// 打开下单完成页面
|
||||||
openFinishPage(resourceObj: any = null) {
|
openFinishPage(resourceObj: any = null) {
|
||||||
this.modalService.create({
|
this.modalService.create({
|
||||||
nzTitle: '',
|
nzTitle: '',
|
||||||
nzContent: PublishSuccessComponent,
|
nzContent: PublishSuccessComponent,
|
||||||
@ -638,8 +613,10 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
|||||||
nzFooter: null,
|
nzFooter: null,
|
||||||
nzComponentParams: { type: 'bulk' }
|
nzComponentParams: { type: 'bulk' }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// 确认提交
|
||||||
submit(submitType?: string): void {
|
submit(submitType?: string): void {
|
||||||
|
// 校验规则
|
||||||
Object.keys(this.validateForm1.controls).forEach(key => {
|
Object.keys(this.validateForm1.controls).forEach(key => {
|
||||||
this.validateForm1.controls[key].markAsDirty();
|
this.validateForm1.controls[key].markAsDirty();
|
||||||
this.validateForm1.controls[key].updateValueAndValidity();
|
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) {
|
if (this.validateForm1.invalid || !this.sf3.valid || !this.sf1.valid|| !this.sf4.valid || !this.sf7.valid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log(this.startInfo)
|
|
||||||
if(typeof(this.validateForm1.value.modifyTime) !== 'string' ) {
|
if(typeof(this.validateForm1.value.modifyTime) !== 'string' ) {
|
||||||
var c = new Date(this.validateForm1.value.modifyTime);
|
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()
|
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;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(params)
|
|
||||||
if(this.PageStatus === '大宗修改') {
|
if(this.PageStatus === '大宗修改') {
|
||||||
this.requests(this.service.$api_set_bulkModify, params);
|
this.requests(this.service.$api_set_bulkModify, params);
|
||||||
} else if(this.PageStatus === '大宗下一单') {
|
} else if(this.PageStatus === '大宗下一单') {
|
||||||
this.requests(this.service.$api_set_saveAnotherBulkOrder, params);
|
this.requests(this.service.$api_set_saveAnotherBulkOrder, params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
requests(url: any, params: any) {
|
requests(url: any, params: any) {
|
||||||
this.service.request(url, params).subscribe((res: any) => {
|
this.service.request(url, params).subscribe((res: any) => {
|
||||||
if (res) {
|
if (res) {
|
||||||
@ -749,7 +723,7 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 打开地图
|
// 打开地图
|
||||||
openMap(type: string, index: number) {
|
openMap(type: string, index: number) {
|
||||||
const modalRef = this.modalService.create({
|
const modalRef = this.modalService.create({
|
||||||
nzTitle: '',
|
nzTitle: '',
|
||||||
nzContent: AmapPoiPickerComponent,
|
nzContent: AmapPoiPickerComponent,
|
||||||
@ -798,12 +772,10 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
|||||||
this.dataR(res);
|
this.dataR(res);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
asds(i: any) {
|
|
||||||
console.log(i)
|
|
||||||
}
|
|
||||||
// 初始化信息
|
// 初始化信息
|
||||||
dataR (res: any) {
|
dataR (res: any) {
|
||||||
// this.dataList = res;
|
// 注:区分编辑和下一单 区别是初始化的时候加不加ID
|
||||||
if (res?.shipperAppUserName) {
|
if (res?.shipperAppUserName) {
|
||||||
const List: any = [];
|
const List: any = [];
|
||||||
this.service.request(this.service.$api_enterpriceList, { enterpriseName: res?.shipperAppUserName }).subscribe(rs => {
|
this.service.request(this.service.$api_enterpriceList, { enterpriseName: res?.shipperAppUserName }).subscribe(rs => {
|
||||||
@ -942,9 +914,11 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
|||||||
remarks: res?.remarks || ''
|
remarks: res?.remarks || ''
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
// 回退
|
||||||
choose(){
|
choose(){
|
||||||
window.history.go(-1);
|
window.history.go(-1);
|
||||||
}
|
}
|
||||||
|
// 选择地址
|
||||||
chooseAddress(index: number, type: string) {
|
chooseAddress(index: number, type: string) {
|
||||||
const modalRef = this.modalService.create({
|
const modalRef = this.modalService.create({
|
||||||
nzTitle: '选择地址',
|
nzTitle: '选择地址',
|
||||||
@ -952,8 +926,6 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
|
|||||||
nzWidth: 900,
|
nzWidth: 900,
|
||||||
nzComponentParams: { spuStatus: '1' },
|
nzComponentParams: { spuStatus: '1' },
|
||||||
nzOnOk: item => {
|
nzOnOk: item => {
|
||||||
console.log(item)
|
|
||||||
console.log(type)
|
|
||||||
const data = item.seleteData;
|
const data = item.seleteData;
|
||||||
if (JSON.stringify(data) === '{}') return;
|
if (JSON.stringify(data) === '{}') return;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
|||||||
@ -1,10 +1,8 @@
|
|||||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
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 { ActivatedRoute, Router } from '@angular/router';
|
||||||
import {
|
import {
|
||||||
SFArrayWidgetSchema,
|
|
||||||
SFComponent,
|
SFComponent,
|
||||||
SFNumberWidgetSchema,
|
|
||||||
SFSchema,
|
SFSchema,
|
||||||
SFSchemaEnum,
|
SFSchemaEnum,
|
||||||
SFSelectWidgetSchema,
|
SFSelectWidgetSchema,
|
||||||
@ -13,18 +11,14 @@ import {
|
|||||||
} from '@delon/form';
|
} from '@delon/form';
|
||||||
import { SettingsService, _HttpClient } from '@delon/theme';
|
import { SettingsService, _HttpClient } from '@delon/theme';
|
||||||
import { ShipperBaseService } from '@shared';
|
import { ShipperBaseService } from '@shared';
|
||||||
import format from 'date-fns/format';
|
import { NzModalService } from 'ng-zorro-antd/modal';
|
||||||
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
|
||||||
import { of } from 'rxjs';
|
import { of } from 'rxjs';
|
||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
import { AmapPoiPickerComponent, AmapService } from 'src/app/shared/components/amap';
|
import { AmapPoiPickerComponent, AmapService } from 'src/app/shared/components/amap';
|
||||||
import { SupplyManagementService } from '../../services/supply-management.service';
|
import { SupplyManagementService } from '../../services/supply-management.service';
|
||||||
import { PublishGoodsChooseFamifiarComponent } from '../choose-famifiar/choose-famifiar.component';
|
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 { PublishAddressListComponent } from '../onecar-publish/address-list/address-list.component';
|
||||||
import { PublishSuccessComponent } from '../onecar-publish/publish-success/publish-success.component';
|
import { PublishSuccessComponent } from '../onecar-publish/publish-success/publish-success.component';
|
||||||
// import { PublishSuccessComponent } from '../publish-success/publish-success.component';
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-publish-goods-bulk-publish',
|
selector: 'app-publish-goods-bulk-publish',
|
||||||
templateUrl: './bulk-release-publish.component.html',
|
templateUrl: './bulk-release-publish.component.html',
|
||||||
@ -33,7 +27,6 @@ import { PublishSuccessComponent } from '../onecar-publish/publish-success/publi
|
|||||||
export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
||||||
@ViewChild('ngForm')
|
@ViewChild('ngForm')
|
||||||
ngForm!: NgForm;
|
ngForm!: NgForm;
|
||||||
|
|
||||||
sf1data: any; // 货源单设置回显
|
sf1data: any; // 货源单设置回显
|
||||||
sf3data: any; // 货源单设置回显
|
sf3data: any; // 货源单设置回显
|
||||||
sf4data: any; // 货源单设置回显
|
sf4data: any; // 货源单设置回显
|
||||||
@ -46,19 +39,11 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
|||||||
id = '';
|
id = '';
|
||||||
type = 'add';
|
type = 'add';
|
||||||
// // 单位
|
// // 单位
|
||||||
unit1 = '吨';
|
|
||||||
unit2 = '方';
|
|
||||||
unit3 = '保价费金额';
|
|
||||||
startInfo: any[] = [];
|
startInfo: any[] = [];
|
||||||
endInfo: any[] = [];
|
endInfo: any[] = [];
|
||||||
|
|
||||||
totalDistance = 0.0; //总里程
|
totalDistance = 0.0; //总里程
|
||||||
totalTime = 0.0; //路程总时间
|
totalTime = 0.0; //路程总时间
|
||||||
|
|
||||||
currentGoodsTypeName: any;
|
|
||||||
|
|
||||||
freightTypeOptions: any;
|
freightTypeOptions: any;
|
||||||
ruleOptions: any;
|
|
||||||
constructor(
|
constructor(
|
||||||
private http: _HttpClient,
|
private http: _HttpClient,
|
||||||
private modalService: NzModalService,
|
private modalService: NzModalService,
|
||||||
@ -69,7 +54,6 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
|||||||
private amapService: AmapService,
|
private amapService: AmapService,
|
||||||
public shipperSrv: ShipperBaseService
|
public shipperSrv: ShipperBaseService
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
@ViewChild('sf1', { static: false }) sf1!: SFComponent;
|
@ViewChild('sf1', { static: false }) sf1!: SFComponent;
|
||||||
schema1: SFSchema = {};
|
schema1: SFSchema = {};
|
||||||
ui1!: SFUISchema;
|
ui1!: SFUISchema;
|
||||||
@ -85,7 +69,7 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
|||||||
@ViewChild('sf6', { static: false }) sf6!: SFComponent;
|
@ViewChild('sf6', { static: false }) sf6!: SFComponent;
|
||||||
schema6: SFSchema = {};
|
schema6: SFSchema = {};
|
||||||
ui6!: SFUISchema;
|
ui6!: SFUISchema;
|
||||||
|
// 初始化
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.initSF1();
|
this.initSF1();
|
||||||
this.initSF3();
|
this.initSF3();
|
||||||
@ -118,7 +102,6 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
initSF1() {
|
initSF1() {
|
||||||
this.schema1 = {
|
this.schema1 = {
|
||||||
properties: {
|
properties: {
|
||||||
@ -231,7 +214,6 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
initSF3() {
|
initSF3() {
|
||||||
this.schema3 = {
|
this.schema3 = {
|
||||||
properties: {
|
properties: {
|
||||||
@ -430,7 +412,6 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
initSF6() {
|
initSF6() {
|
||||||
this.schema6 = {
|
this.schema6 = {
|
||||||
properties: {
|
properties: {
|
||||||
@ -543,6 +524,7 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
// 选择收回单地址
|
||||||
backBillChange() {
|
backBillChange() {
|
||||||
const modalRef = this.modalService.create({
|
const modalRef = this.modalService.create({
|
||||||
nzTitle: '选择收回单地址',
|
nzTitle: '选择收回单地址',
|
||||||
@ -587,6 +569,7 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
|||||||
nzComponentParams: { type: 'bulk' }
|
nzComponentParams: { type: 'bulk' }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// 确认提交(下单)
|
||||||
submit(submitType: string): void {
|
submit(submitType: string): void {
|
||||||
Object.keys(this.ngForm.form.controls).forEach(key => {
|
Object.keys(this.ngForm.form.controls).forEach(key => {
|
||||||
this.ngForm.form.controls[key].markAsDirty();
|
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) {
|
if (this.ngForm.form.invalid || !this.sf1.valid || !this.sf3.valid || !this.sf4.valid || !this.sf6.valid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// //装卸货信息
|
// //装卸货信息
|
||||||
const LoadingList = this.startInfo.concat(this.endInfo);
|
const LoadingList = this.startInfo.concat(this.endInfo);
|
||||||
// 货物信息
|
// 货物信息
|
||||||
@ -626,7 +608,6 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
|||||||
|
|
||||||
let reqUrl = this.service.$api_consignBulk;
|
let reqUrl = this.service.$api_consignBulk;
|
||||||
if (submitType === 'assign') {
|
if (submitType === 'assign') {
|
||||||
console.log('params', params);
|
|
||||||
this.chooseFamifiar(params);
|
this.chooseFamifiar(params);
|
||||||
} else {
|
} else {
|
||||||
this.service.request(reqUrl, params).subscribe(res => {
|
this.service.request(reqUrl, params).subscribe(res => {
|
||||||
@ -644,7 +625,6 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
// 获取城市列表
|
// 获取城市列表
|
||||||
getRegionCode(regionCode: any) {
|
getRegionCode(regionCode: any) {
|
||||||
console.log(regionCode);
|
|
||||||
return this.service
|
return this.service
|
||||||
.request(this.service.$api_get_enterprise_project, { id: regionCode })
|
.request(this.service.$api_get_enterprise_project, { id: regionCode })
|
||||||
.pipe(
|
.pipe(
|
||||||
@ -698,7 +678,7 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// 选择地址
|
||||||
chooseAddress(index: number, type: string) {
|
chooseAddress(index: number, type: string) {
|
||||||
const modalRef = this.modalService.create({
|
const modalRef = this.modalService.create({
|
||||||
nzTitle: '选择地址',
|
nzTitle: '选择地址',
|
||||||
@ -741,6 +721,7 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// 返回上一页
|
||||||
goBack() {
|
goBack() {
|
||||||
window.history.go(-1);
|
window.history.go(-1);
|
||||||
}
|
}
|
||||||
@ -772,7 +753,4 @@ export class SupplyManagementBulkReleasePublishComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
choose() {
|
|
||||||
window.history.go(-1);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -44,7 +44,7 @@
|
|||||||
<nz-form-label [nzSpan]="4" nzRequired>联系人</nz-form-label>
|
<nz-form-label [nzSpan]="4" nzRequired>联系人</nz-form-label>
|
||||||
<nz-form-control [nzErrorTip]="'请输入联系人信息'">
|
<nz-form-control [nzErrorTip]="'请输入联系人信息'">
|
||||||
<div class="align-center">
|
<div class="align-center">
|
||||||
<input nz-input [(ngModel)]="data.appUserName" formControlName="loadName{{ idx }}" maxlength="30" />
|
<input nz-input [(ngModel)]="data.appUserName" formControlName="loadName{{ idx }}" maxlength="30" />
|
||||||
<input
|
<input
|
||||||
style="margin-left: 12px"
|
style="margin-left: 12px"
|
||||||
nz-input
|
nz-input
|
||||||
@ -280,7 +280,7 @@
|
|||||||
</nz-card>
|
</nz-card>
|
||||||
<nz-card>
|
<nz-card>
|
||||||
<div class="align-center">
|
<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 *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 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()"
|
<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 { 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 { ActivatedRoute, Router } from '@angular/router';
|
||||||
import {
|
import {
|
||||||
SFComponent,
|
SFComponent,
|
||||||
@ -13,15 +13,13 @@ import {
|
|||||||
import { _HttpClient } from '@delon/theme';
|
import { _HttpClient } from '@delon/theme';
|
||||||
import { AmapPoiPickerComponent, AmapService, ShipperBaseService } from '@shared';
|
import { AmapPoiPickerComponent, AmapService, ShipperBaseService } from '@shared';
|
||||||
import { NzModalService } from 'ng-zorro-antd/modal';
|
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 { 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 { PublishAddressListComponent } from './address-list/address-list.component';
|
||||||
import { PublishSuccessComponent } from './publish-success/publish-success.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({
|
@Component({
|
||||||
selector: 'app-publish-goods-onecar-publish',
|
selector: 'app-publish-goods-onecar-publish',
|
||||||
templateUrl: './onecar-publish.component.html',
|
templateUrl: './onecar-publish.component.html',
|
||||||
@ -29,7 +27,6 @@ import { SupplyManagementVehicleAssignedCarComponent } from '../assigned-car/ass
|
|||||||
})
|
})
|
||||||
export class SupplyManagementOnecarPublishComponent implements OnInit {
|
export class SupplyManagementOnecarPublishComponent implements OnInit {
|
||||||
validateForm1: FormGroup;
|
validateForm1: FormGroup;
|
||||||
newTempchecked = false; //是否存入新模板
|
|
||||||
sf1data: any; // 货源单设置回显
|
sf1data: any; // 货源单设置回显
|
||||||
sf3data: any; // 货源单设置回显
|
sf3data: any; // 货源单设置回显
|
||||||
sf4data: any; // 货源单设置回显
|
sf4data: any; // 货源单设置回显
|
||||||
@ -43,17 +40,11 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
totalDistance = 0.0; //总里程
|
totalDistance = 0.0; //总里程
|
||||||
totalTime = 0.0; //路程总时间
|
totalTime = 0.0; //路程总时间
|
||||||
currentRate = 0; //实时计算的费率
|
currentRate = 0; //实时计算的费率
|
||||||
|
|
||||||
npp = false;
|
|
||||||
id = this.route.snapshot.params.id;
|
id = this.route.snapshot.params.id;
|
||||||
// // 单位
|
// // 单位
|
||||||
unit1 = '吨';
|
startInfo: any = []; // 发货地数据
|
||||||
unit2 = '方';
|
endInfo: any = []; // 卸货地数据
|
||||||
unit3 = '保价费金额';
|
|
||||||
startInfo: any = [];
|
|
||||||
endInfo: any = [];
|
|
||||||
PageStatus = '';
|
PageStatus = '';
|
||||||
dataList: any;
|
|
||||||
enterpriseProjectIds: any;
|
enterpriseProjectIds: any;
|
||||||
constructor(
|
constructor(
|
||||||
private http: _HttpClient,
|
private http: _HttpClient,
|
||||||
@ -97,16 +88,12 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
@ViewChild('sf7', { static: false }) sf7!: SFComponent;
|
@ViewChild('sf7', { static: false }) sf7!: SFComponent;
|
||||||
schema7: SFSchema = {};
|
schema7: SFSchema = {};
|
||||||
ui7!: SFUISchema;
|
ui7!: SFUISchema;
|
||||||
|
// 页面初始化
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
if (this.route.snapshot?.queryParams?.sta === '1') {
|
if (this.route.snapshot?.queryParams?.sta === '1') {
|
||||||
console.log('修改');
|
|
||||||
this.PageStatus = '整车修改';
|
this.PageStatus = '整车修改';
|
||||||
} else if (this.route.snapshot?.queryParams?.sta === '2') {
|
} else if (this.route.snapshot?.queryParams?.sta === '2') {
|
||||||
this.PageStatus = '整车下一单';
|
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.initSF1();
|
||||||
this.initSF3();
|
this.initSF3();
|
||||||
@ -116,7 +103,6 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
this.initSF7();
|
this.initSF7();
|
||||||
this.initdata();
|
this.initdata();
|
||||||
}
|
}
|
||||||
|
|
||||||
initSF1() {
|
initSF1() {
|
||||||
this.schema1 = {
|
this.schema1 = {
|
||||||
properties: {
|
properties: {
|
||||||
@ -141,7 +127,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
},
|
},
|
||||||
change: (q: any) => {
|
change: (q: any) => {
|
||||||
this.getRegionCode(q);
|
this.getRegionCode(q);
|
||||||
},
|
}
|
||||||
} as SFSelectWidgetSchema
|
} as SFSelectWidgetSchema
|
||||||
},
|
},
|
||||||
enterpriseProjectId: {
|
enterpriseProjectId: {
|
||||||
@ -149,7 +135,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
title: '项目',
|
title: '项目',
|
||||||
ui: {
|
ui: {
|
||||||
widget: 'select',
|
widget: 'select',
|
||||||
placeholder: '请选择',
|
placeholder: '请选择'
|
||||||
} as SFSelectWidgetSchema
|
} as SFSelectWidgetSchema
|
||||||
},
|
},
|
||||||
enterpriseInfoName: {
|
enterpriseInfoName: {
|
||||||
@ -172,8 +158,8 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
title: '手机号',
|
title: '手机号',
|
||||||
maxLength: 30,
|
maxLength: 30,
|
||||||
ui: {
|
ui: {
|
||||||
hidden: true,
|
hidden: true,
|
||||||
placeholder: '请输入'
|
placeholder: '请输入'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
dispatchName: {
|
dispatchName: {
|
||||||
@ -193,18 +179,18 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
placeholder: '请选择',
|
placeholder: '请选择',
|
||||||
allowClear: true,
|
allowClear: true,
|
||||||
optionalHelp: '选择调度员,司机直接联系调度员 ; 不选择,司机直接联系您',
|
optionalHelp: '选择调度员,司机直接联系调度员 ; 不选择,司机直接联系您',
|
||||||
change: (value: any, data: any) => {
|
change: (_value: any, data: any) => {
|
||||||
if(data.label) {
|
if (data.label) {
|
||||||
const dat = data.label.split('/')
|
const dat = data.label.split('/');
|
||||||
this.sf1.setValue('/dispatchName', dat[0]);
|
this.sf1.setValue('/dispatchName', dat[0]);
|
||||||
this.sf1.setValue('/dispatchPhone', dat[1]);
|
this.sf1.setValue('/dispatchPhone', dat[1]);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
asyncData: () => this.shipperSrv.getStaffList2()
|
asyncData: () => this.shipperSrv.getStaffList2()
|
||||||
} as SFSelectWidgetSchema
|
} as SFSelectWidgetSchema
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
required: ['shipperAppUserId','enterpriseProjectId','dispatchId']
|
required: ['shipperAppUserId', 'enterpriseProjectId', 'dispatchId']
|
||||||
};
|
};
|
||||||
this.ui1 = {
|
this.ui1 = {
|
||||||
'*': {
|
'*': {
|
||||||
@ -251,7 +237,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
widget: 'select',
|
widget: 'select',
|
||||||
placeholder: '请选择',
|
placeholder: '请选择',
|
||||||
errors: { required: '请填写货物名称' },
|
errors: { required: '请填写货物名称' },
|
||||||
change: (value: any, data: any) => {
|
change: (_value: any, data: any) => {
|
||||||
this.sf3.setValue('/goodsName', data.label);
|
this.sf3.setValue('/goodsName', data.label);
|
||||||
},
|
},
|
||||||
visibleIf: {
|
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() {
|
initSF5() {
|
||||||
this.schema5 = {
|
this.schema5 = {
|
||||||
properties: {
|
properties: {
|
||||||
@ -409,7 +372,6 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
initSF6() {
|
initSF6() {
|
||||||
this.schema6 = {
|
this.schema6 = {
|
||||||
properties: {
|
properties: {
|
||||||
@ -504,7 +466,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
} as SFTextareaWidgetSchema
|
} as SFTextareaWidgetSchema
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
required: ['stateReceipt', 'receiptType', 'receiptAddressId',]
|
required: ['stateReceipt', 'receiptType', 'receiptAddressId']
|
||||||
};
|
};
|
||||||
this.ui6 = {
|
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() {
|
initSF7() {
|
||||||
this.schema7 = {
|
this.schema7 = {
|
||||||
properties: {
|
properties: {
|
||||||
@ -532,7 +485,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
default: 0,
|
default: 0,
|
||||||
ui: {
|
ui: {
|
||||||
prefix: '¥',
|
prefix: '¥',
|
||||||
change: args => this.payChange()
|
change: _args => this.payChange()
|
||||||
} as SFNumberWidgetSchema
|
} as SFNumberWidgetSchema
|
||||||
},
|
},
|
||||||
toPay: {
|
toPay: {
|
||||||
@ -540,21 +493,21 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
title: '到付',
|
title: '到付',
|
||||||
minimum: 0,
|
minimum: 0,
|
||||||
default: 0,
|
default: 0,
|
||||||
ui: { prefix: '¥', change: args => this.payChange() } as SFNumberWidgetSchema
|
ui: { prefix: '¥', change: _args => this.payChange() } as SFNumberWidgetSchema
|
||||||
},
|
},
|
||||||
oilCardPay: {
|
oilCardPay: {
|
||||||
type: 'number',
|
type: 'number',
|
||||||
title: '油卡',
|
title: '油卡',
|
||||||
minimum: 0,
|
minimum: 0,
|
||||||
default: 0,
|
default: 0,
|
||||||
ui: { prefix: '¥', change: args => this.payChange() } as SFNumberWidgetSchema
|
ui: { prefix: '¥', change: _args => this.payChange() } as SFNumberWidgetSchema
|
||||||
},
|
},
|
||||||
receiptPay: {
|
receiptPay: {
|
||||||
type: 'number',
|
type: 'number',
|
||||||
title: '回单付',
|
title: '回单付',
|
||||||
minimum: 0,
|
minimum: 0,
|
||||||
default: 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 },
|
subtotal: { type: 'number', title: '小计', default: 0, ui: { widget: 'custom' } as SFNumberWidgetSchema },
|
||||||
appendFee: { type: 'number', title: '附加费', default: 0, ui: { widget: 'custom' } as SFNumberWidgetSchema },
|
appendFee: { type: 'number', title: '附加费', default: 0, ui: { widget: 'custom' } as SFNumberWidgetSchema },
|
||||||
@ -578,38 +531,74 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
payChange(value?: any) {
|
// 获取城市列表
|
||||||
let subtotal: any ={}
|
getRegionCode(regionCode: any) {
|
||||||
let oilCardPay: any ={}
|
console.log(regionCode);
|
||||||
if(value) {
|
return this.service
|
||||||
subtotal = (value.prePay +value.toPay + value.oilCardPay + value.receiptPay) || 0;
|
.request(this.service.$api_get_enterprise_project, { id: regionCode })
|
||||||
oilCardPay = value.oilCardPay || 0;
|
.pipe(
|
||||||
} else {
|
map(res =>
|
||||||
subtotal = (this.sf7.value.prePay + this.sf7.value.toPay + this.sf7.value.oilCardPay + this.sf7.value.receiptPay) || 0;
|
res.map((item: any) => ({
|
||||||
oilCardPay = this.sf7.value.oilCardPay || 0;
|
label: item.projectName,
|
||||||
}
|
value: item.id
|
||||||
console.log(this.sf7.value)
|
}))
|
||||||
|
)
|
||||||
this.service.request(this.service.$api_getCalculatedSurcharge + `?totalFreight=${subtotal}&fuelCardAmount=${oilCardPay}`).subscribe(res => {
|
)
|
||||||
if (res) {
|
.subscribe(res => {
|
||||||
this.sf7.setValue('/appendFee', res.surcharge);
|
this.sf1.getProperty('/enterpriseProjectId')!.schema.enum = res;
|
||||||
this.sf7.setValue('/subtotal', subtotal);
|
this.sf1.getProperty('/enterpriseProjectId')!.widget.reset(res);
|
||||||
this.sf7.setValue('/total', subtotal + res.surcharge);
|
console.log('12345645454545454=============');
|
||||||
this.service.request(this.service.$api_getcalculatedServiceRate + `?invoiceAmount=${subtotal + res.surcharge}&totalFreight=${subtotal}`).subscribe(res => {
|
console.log(this.enterpriseProjectIds);
|
||||||
if (res) {
|
console.log(res);
|
||||||
this.currentRate = res.rate * 100;
|
if (this.enterpriseProjectIds) {
|
||||||
} else {
|
this.sf1.setValue('/enterpriseProjectId', this.enterpriseProjectIds);
|
||||||
this.service.msgSrv.error(res.msg);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
this.service.msgSrv.error(res.msg);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
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 = {};
|
||||||
|
if (value) {
|
||||||
|
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;
|
||||||
|
oilCardPay = this.sf7.value.oilCardPay || 0;
|
||||||
|
}
|
||||||
|
console.log(this.sf7.value);
|
||||||
|
|
||||||
addStartInfo(event: any) {
|
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 => {
|
||||||
|
if (res) {
|
||||||
|
this.currentRate = res.rate * 100;
|
||||||
|
} else {
|
||||||
|
this.service.msgSrv.error(res.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.service.msgSrv.error(res.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// 添加 删除发货卸货地址
|
||||||
|
addStartInfo(_event: any) {
|
||||||
if (this.startInfo.length < 5) {
|
if (this.startInfo.length < 5) {
|
||||||
const controlId = this.startInfo.length;
|
const controlId = this.startInfo.length;
|
||||||
this.startInfo.push({
|
this.startInfo.push({
|
||||||
@ -628,6 +617,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
this.validateForm1.addControl(`loadPhone${controlId}`, new FormControl(null, Validators.required));
|
this.validateForm1.addControl(`loadPhone${controlId}`, new FormControl(null, Validators.required));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 添加 删除发货卸货地址
|
||||||
subStartInfo(event: any, index: number, id?: any) {
|
subStartInfo(event: any, index: number, id?: any) {
|
||||||
console.log(event, index, id);
|
console.log(event, index, id);
|
||||||
if (id) {
|
if (id) {
|
||||||
@ -640,6 +630,39 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
this.validateForm1.removeControl(`loadName${index}`);
|
this.validateForm1.removeControl(`loadName${index}`);
|
||||||
this.validateForm1.removeControl(`loadPhone${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) {
|
changeGoodsType(value: string, data: any) {
|
||||||
if (data.label === '其它') return;
|
if (data.label === '其它') return;
|
||||||
const params = {
|
const params = {
|
||||||
@ -660,50 +683,17 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
if (res) {
|
if (res) {
|
||||||
this.sf3.getProperty('/goodsNameId')!.schema.enum = res;
|
this.sf3.getProperty('/goodsNameId')!.schema.enum = res;
|
||||||
this.sf3.getProperty('/goodsNameId')!.widget?.reset(res);
|
this.sf3.getProperty('/goodsNameId')!.widget?.reset(res);
|
||||||
if(this.sf3data.goodsNameId){
|
if (this.sf3data.goodsNameId) {
|
||||||
this.sf3.setValue('/goodsNameId',this.sf3data.goodsNameId);
|
this.sf3.setValue('/goodsNameId', this.sf3data.goodsNameId);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.service.msgSrv.error(res.msg);
|
this.service.msgSrv.error(res.msg);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
//指派熟车
|
||||||
addEndInfo(event: any) {
|
chooseFamifiar(item: any) {
|
||||||
if (this.addEndInfo.length < 5) {
|
console.log('999');
|
||||||
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')
|
|
||||||
const modalRef = this.modalService.create({
|
const modalRef = this.modalService.create({
|
||||||
nzTitle: '指派熟车',
|
nzTitle: '指派熟车',
|
||||||
nzContent: SupplyManagementVehicleAssignedCarComponent,
|
nzContent: SupplyManagementVehicleAssignedCarComponent,
|
||||||
@ -713,7 +703,6 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
url: this.service.$api_save_assign_whole,
|
url: this.service.$api_save_assign_whole,
|
||||||
params: item,
|
params: item,
|
||||||
type: 'next'
|
type: 'next'
|
||||||
|
|
||||||
},
|
},
|
||||||
nzFooter: null
|
nzFooter: null
|
||||||
});
|
});
|
||||||
@ -723,31 +712,32 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 打开下单完成页面
|
// 打开下单完成页面
|
||||||
openFinishPage(resourceObj: any = null) {
|
openFinishPage(resourceObj: any = null) {
|
||||||
this.modalService.create({
|
this.modalService.create({
|
||||||
nzTitle: '',
|
nzTitle: '',
|
||||||
nzContent: PublishSuccessComponent,
|
nzContent: PublishSuccessComponent,
|
||||||
nzWidth: 900,
|
nzWidth: 900,
|
||||||
nzFooter: null,
|
nzFooter: null,
|
||||||
nzComponentParams: { type: 'onecar', resourceObj }
|
nzComponentParams: { type: 'onecar', resourceObj }
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 提交前确认,委托运输协议弹窗
|
// 提交前确认,委托运输协议弹窗
|
||||||
submitConfirm(submitType?: any) {
|
submitConfirm(submitType?: any) {
|
||||||
const modalRef = this.modalService.create({
|
const modalRef = this.modalService.create({
|
||||||
nzTitle: '运输协议',
|
nzTitle: '运输协议',
|
||||||
nzContent: TranAgreementComponent,
|
nzContent: TranAgreementComponent,
|
||||||
nzWidth: 900,
|
nzWidth: 900,
|
||||||
nzFooter: null,
|
nzFooter: null,
|
||||||
nzComponentParams: { type: 'next' }
|
nzComponentParams: { type: 'next' }
|
||||||
});
|
});
|
||||||
modalRef.afterClose.subscribe(result => {
|
modalRef.afterClose.subscribe(result => {
|
||||||
if (result) {
|
if (result) {
|
||||||
this.submit(submitType);
|
this.submit(submitType);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// 提交
|
||||||
submit(submitType?: string): void {
|
submit(submitType?: string): void {
|
||||||
Object.keys(this.validateForm1.controls).forEach(key => {
|
Object.keys(this.validateForm1.controls).forEach(key => {
|
||||||
this.validateForm1.controls[key].markAsDirty();
|
this.validateForm1.controls[key].markAsDirty();
|
||||||
@ -758,8 +748,8 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
this.sf4.validator({ emitError: true });
|
this.sf4.validator({ emitError: true });
|
||||||
this.sf6.validator({ emitError: true });
|
this.sf6.validator({ emitError: true });
|
||||||
this.sf7.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) {
|
if (this.validateForm1.invalid || !this.sf3.valid || !this.sf1.valid || !this.sf4.valid || !this.sf6.valid || !this.sf7.valid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (typeof this.validateForm1.value.unloadingTime !== 'string') {
|
if (typeof this.validateForm1.value.unloadingTime !== 'string') {
|
||||||
@ -814,7 +804,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
totalFees: this.totalFees
|
totalFees: this.totalFees
|
||||||
};
|
};
|
||||||
console.log(params);
|
console.log(params);
|
||||||
if(submitType) {
|
if (submitType) {
|
||||||
if (submitType == 'assign') {
|
if (submitType == 'assign') {
|
||||||
this.chooseFamifiar(params);
|
this.chooseFamifiar(params);
|
||||||
return;
|
return;
|
||||||
@ -833,6 +823,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
return num;
|
return num;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 下单成功提示弹窗
|
||||||
requests(url: any, params: any) {
|
requests(url: any, params: any) {
|
||||||
this.service.request(url, params).subscribe((res: any) => {
|
this.service.request(url, params).subscribe((res: any) => {
|
||||||
if (res) {
|
if (res) {
|
||||||
@ -889,21 +880,18 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
// 返回上一页
|
||||||
goBack() {
|
goBack() {
|
||||||
window.history.go(-1);
|
window.history.go(-1);
|
||||||
}
|
}
|
||||||
// 初始化信息
|
// 初始化赋值信息
|
||||||
initdata() {
|
initdata() {
|
||||||
this.service.request(`${this.service.$api_get_getCompleteVehicleDetail}`, { id: this.id }).subscribe(res => {
|
this.service.request(`${this.service.$api_get_getCompleteVehicleDetail}`, { id: this.id }).subscribe(res => {
|
||||||
this.dataR(res);
|
this.dataR(res);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
asds(i: any) {
|
// 初始化赋值信息函数
|
||||||
console.log(i);
|
|
||||||
}
|
|
||||||
// 初始化信息
|
|
||||||
dataR(res: any) {
|
dataR(res: any) {
|
||||||
// this.dataList = res;
|
|
||||||
if (res?.shipperAppUserName) {
|
if (res?.shipperAppUserName) {
|
||||||
const List: any = [];
|
const List: any = [];
|
||||||
this.service.request(this.service.$api_enterpriceList, { enterpriseName: res?.shipperAppUserName }).subscribe(rs => {
|
this.service.request(this.service.$api_enterpriceList, { enterpriseName: res?.shipperAppUserName }).subscribe(rs => {
|
||||||
@ -918,8 +906,8 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if(res?.enterpriseProjectId) {
|
if (res?.enterpriseProjectId) {
|
||||||
this.enterpriseProjectIds = res.enterpriseProjectId
|
this.enterpriseProjectIds = res.enterpriseProjectId;
|
||||||
}
|
}
|
||||||
this.sf1data = {
|
this.sf1data = {
|
||||||
enterpriseInfoName: res?.enterpriseInfoName,
|
enterpriseInfoName: res?.enterpriseInfoName,
|
||||||
@ -1002,7 +990,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
goodsTypeId: res?.goodsInfoVOList[0]?.goodsTypeId || '',
|
goodsTypeId: res?.goodsInfoVOList[0]?.goodsTypeId || '',
|
||||||
goodsTypeName: res?.goodsInfoVOList[0]?.goodsTypeName || '',
|
goodsTypeName: res?.goodsInfoVOList[0]?.goodsTypeName || '',
|
||||||
goodsNameId: res?.goodsInfoVOList[0]?.goodsNameId || '',
|
goodsNameId: res?.goodsInfoVOList[0]?.goodsNameId || '',
|
||||||
goodsName: res?.goodsInfoVOList[0]?.goodsName || '',
|
goodsName: res?.goodsInfoVOList[0]?.goodsName || ''
|
||||||
};
|
};
|
||||||
if (this.sf3data.goodsTypeName === '其它') {
|
if (this.sf3data.goodsTypeName === '其它') {
|
||||||
this.sf3data.goodsName1 = res?.goodsInfoVOList[0]?.goodsName || '';
|
this.sf3data.goodsName1 = res?.goodsInfoVOList[0]?.goodsName || '';
|
||||||
@ -1049,9 +1037,9 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
area: res?.supplementaryInformationVO?.area || '',
|
area: res?.supplementaryInformationVO?.area || '',
|
||||||
phon: res?.supplementaryInformationVO?.phon || '',
|
phon: res?.supplementaryInformationVO?.phon || '',
|
||||||
address: res?.supplementaryInformationVO?.address || '',
|
address: res?.supplementaryInformationVO?.address || '',
|
||||||
remarks: res?.supplementaryInformationVO?.remarks || '',
|
remarks: res?.supplementaryInformationVO?.remarks || ''
|
||||||
};
|
};
|
||||||
// if (this.PageStatus === '整车修改') {
|
// if (this.PageStatus === '整车修改') {
|
||||||
// this.sf6data.id = res?.supplementaryInformationVO?.id
|
// this.sf6data.id = res?.supplementaryInformationVO?.id
|
||||||
// }
|
// }
|
||||||
this.sf7data = {
|
this.sf7data = {
|
||||||
@ -1066,6 +1054,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
};
|
};
|
||||||
this.payChange(this.sf7data);
|
this.payChange(this.sf7data);
|
||||||
}
|
}
|
||||||
|
// 选择收回单地址
|
||||||
backBillChange() {
|
backBillChange() {
|
||||||
const modalRef = this.modalService.create({
|
const modalRef = this.modalService.create({
|
||||||
nzTitle: '选择收回单地址',
|
nzTitle: '选择收回单地址',
|
||||||
@ -1083,9 +1072,7 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
choose(){
|
// 选择地址
|
||||||
window.history.go(-1);
|
|
||||||
}
|
|
||||||
chooseAddress(index: number, type: string) {
|
chooseAddress(index: number, type: string) {
|
||||||
const modalRef = this.modalService.create({
|
const modalRef = this.modalService.create({
|
||||||
nzTitle: '选择地址',
|
nzTitle: '选择地址',
|
||||||
@ -1093,8 +1080,8 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
nzWidth: 900,
|
nzWidth: 900,
|
||||||
nzComponentParams: { spuStatus: '1' },
|
nzComponentParams: { spuStatus: '1' },
|
||||||
nzOnOk: item => {
|
nzOnOk: item => {
|
||||||
console.log(item)
|
console.log(item);
|
||||||
console.log(type)
|
console.log(type);
|
||||||
const data = item.seleteData;
|
const data = item.seleteData;
|
||||||
if (JSON.stringify(data) === '{}') return;
|
if (JSON.stringify(data) === '{}') return;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
@ -1130,5 +1117,4 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -324,6 +324,6 @@
|
|||||||
[nzLoading]="service.http.loading"
|
[nzLoading]="service.http.loading"
|
||||||
>保存</button
|
>保存</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>
|
</div>
|
||||||
</nz-card>
|
</nz-card>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user