This commit is contained in:
wangshiming
2022-03-04 13:34:13 +08:00
parent 3b884de222
commit a98a0592ea
5 changed files with 233 additions and 280 deletions

View File

@ -4,7 +4,7 @@
* @Author : Shiming * @Author : Shiming
* @Date : 2021-12-24 16:58:02 * @Date : 2021-12-24 16:58:02
* @LastEditors : Shiming * @LastEditors : Shiming
* @LastEditTime : 2022-03-01 13:42:44 * @LastEditTime : 2022-03-04 13:33:51
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\bulk-detail-change\\bulk-detail-change.component.html * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\bulk-detail-change\\bulk-detail-change.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
--> -->
@ -34,7 +34,7 @@
<sv label="货主">{{ i?.goodsResource?.shipperAppUserName }} </sv> <sv label="货主">{{ i?.goodsResource?.shipperAppUserName }} </sv>
<sv label="所属项目">{{i?.goodsResource?.enterpriseProjectName}}</sv> <sv label="所属项目">{{i?.goodsResource?.enterpriseProjectName}}</sv>
<sv label="服务类型">{{i?.goodsResource?.serviceTypeLabel}}</sv> <sv label="服务类型">{{i?.goodsResource?.serviceTypeLabel}}</sv>
<sv label="录单员">{{i?.goodsResource?.createUserName}} /{{i?.goodsResource?.createUserPhone}} </sv> <sv label="录单员">{{i?.createUserName}} /{{i?.createUserPhone}} </sv>
<sv label="调度员">{{i?.goodsResource?.dispatchName}}/{{i?.goodsResource?.dispatchPhone}} </sv> <sv label="调度员">{{i?.goodsResource?.dispatchName}}/{{i?.goodsResource?.dispatchPhone}} </sv>
</div> </div>
<nz-tabset style="margin-top: 15px;"> <nz-tabset style="margin-top: 15px;">
@ -125,7 +125,8 @@
</div> </div>
<div nz-col [nzSpan]="4"> <div nz-col [nzSpan]="4">
<div style="display: flex; justify-content: center"> <div style="display: flex; justify-content: center">
<span style="padding: 24 px; font-size: 30px; color: #7d7d7d"><i nz-icon nzType="swap" nzTheme="outline"></i></span> <span class="swap-icon" (click)="swapAddress()"><i nz-icon nzType="swap"
nzTheme="outline"></i></span>
</div> </div>
</div> </div>
<div nz-col [nzSpan]="10"> <div nz-col [nzSpan]="10">
@ -177,7 +178,7 @@
</div> </div>
</div> </div>
</div> </div>
<div nz-row [nzGutter]="24" style="margin-top: 24px"> <!-- <div nz-row [nzGutter]="24" style="margin-top: 24px">
<div nz-col [nzSpan]="10"> <div nz-col [nzSpan]="10">
<nz-form-item> <nz-form-item>
<nz-form-label [nzSpan]="4" nzRequired>装货时间</nz-form-label> <nz-form-label [nzSpan]="4" nzRequired>装货时间</nz-form-label>
@ -195,7 +196,7 @@
</nz-form-control> </nz-form-control>
</nz-form-item> </nz-form-item>
</div> </div>
</div> </div> -->
<ng-template #endInconTemp1><i nz-icon nzType="environment" nzTheme="outline"></i></ng-template> <ng-template #endInconTemp1><i nz-icon nzType="environment" nzTheme="outline"></i></ng-template>
</form> </form>
</nz-card> </nz-card>
@ -205,18 +206,7 @@
<sf #sf3 [schema]="schema3" [formData]="sf3data" [button]="'none'" [ui]="ui3"></sf> <sf #sf3 [schema]="schema3" [formData]="sf3data" [button]="'none'" [ui]="ui3"></sf>
<sf #sf4 [schema]="schema4" [formData]="sf4data" [button]="'none'" [ui]="ui4"> <sf #sf4 [schema]="schema4" [formData]="sf4data" [button]="'none'" [ui]="ui4">
<ng-template sf-template="weight" let-item let-ui="ui"> <ng-template sf-template="weight" let-item let-ui="ui">
<nz-input-group [nzAddOnAfter]="''"> {{i?.goodsInfoList?.[0]?.weight}}吨,{{i?.goodsInfoList?.[0]?.volume}}方,{{i?.goodsInfoList?.[0]?.number}}件
<input
nz-input
type="number"
[ngModel]="item.value"
min="0"
[max]="999999"
step="0.01"
(ngModelChange)="item.setValue($event)"
placeholder="总重量,必填"
/>
</nz-input-group>
</ng-template> </ng-template>
<ng-template sf-template="volume" let-item let-ui="ui"> <ng-template sf-template="volume" let-item let-ui="ui">
<nz-input-group [nzAddOnAfter]="''"> <nz-input-group [nzAddOnAfter]="''">

View File

@ -4,7 +4,7 @@
* @Author : Shiming * @Author : Shiming
* @Date : 2021-12-24 16:58:02 * @Date : 2021-12-24 16:58:02
* @LastEditors : Shiming * @LastEditors : Shiming
* @LastEditTime : 2022-02-28 12:01:57 * @LastEditTime : 2022-03-04 13:26:50
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\bulk-detail-change\\bulk-detail-change.component.ts * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\bulk-detail-change\\bulk-detail-change.component.ts
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
*/ */
@ -438,7 +438,13 @@ loadTime: any; // 货源单设置回显
this.loadTime = res.loadTime this.loadTime = res.loadTime
this.unloadTime = res.unloadTime this.unloadTime = res.unloadTime
this.dirvingMessage = res.billExpenseDetails; this.dirvingMessage = res.billExpenseDetails;
// 计算里程,时间
if (this.startInfo[0]?.area && this.endInfo[0]?.area) {
this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => {
this.totalDistance = res.distance;
this.totalTime = res.time;
});
}
} }
}) })
} }
@ -516,6 +522,7 @@ loadTime: any; // 货源单设置回显
// -------------------装卸货信息处理 // -------------------装卸货信息处理
// 打开地图 // 打开地图
// 打开地图 // 打开地图
// 打开地图
openMap(type: string, index: number) { openMap(type: string, index: number) {
const modalRef = this.modalService.create({ const modalRef = this.modalService.create({
nzTitle: '', nzTitle: '',
@ -523,30 +530,32 @@ loadTime: any; // 货源单设置回显
nzWidth: 900, nzWidth: 900,
nzOnOk: item => { nzOnOk: item => {
const poi = item.poi; const poi = item.poi;
const locList = poi.pois; const locList = poi.location.toString().split(',');
switch (type) { switch (type) {
case 'start': case 'start':
this.startInfo[index].detailedAddress = poi.formattedAddress; this.startInfo[index].detailedAddress = poi.district + poi.name;
this.startInfo[index].longitude = locList[0]; this.startInfo[index].longitude = locList[0];
this.startInfo[index].latitude = locList[1]; this.startInfo[index].latitude = locList[1];
this.startInfo[index].province = poi.addressComponent.province; this.startInfo[index].province = poi.cityInfo.province;
this.startInfo[index].city = poi.addressComponent.city; this.startInfo[index].city = poi.cityInfo.city;
this.startInfo[index].area = poi.addressComponent.district; this.startInfo[index].area = poi.cityInfo.district;
this.startInfo[index].address = poi.name;
break; break;
case 'end': case 'end':
this.endInfo[index].detailedAddress = poi.formattedAddress; this.endInfo[index].detailedAddress = poi.district + poi.name;
this.endInfo[index].longitude = locList[0]; this.endInfo[index].longitude = locList[0];
this.endInfo[index].latitude = locList[1]; this.endInfo[index].latitude = locList[1];
this.endInfo[index].province = poi.addressComponent.province; this.endInfo[index].province = poi.cityInfo.province;
this.endInfo[index].city = poi.addressComponent.city; this.endInfo[index].city = poi.cityInfo.city;
this.endInfo[index].area = poi.addressComponent.district; this.endInfo[index].area = poi.cityInfo.district;
this.endInfo[index].address = poi.name;
break; break;
default: default:
break; break;
} }
if (this.startInfo[0]?.area && this.endInfo[0]?.area) { if (this.startInfo[0]?.area && this.endInfo[0]?.area) {
this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => { this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe((res: any) => {
this.totalDistance = res.distance; this.totalDistance = res.distance;
this.totalTime = res.time; this.totalTime = res.time;
}); });
@ -554,7 +563,6 @@ loadTime: any; // 货源单设置回显
} }
}); });
} }
initSF3() { initSF3() {
this.schema3 = { this.schema3 = {
properties: { properties: {
@ -631,94 +639,6 @@ loadTime: any; // 货源单设置回显
} }
}; };
} }
initSF4() {
this.schema4 = {
properties: {
weight: {
type: 'string',
title: '货物数量',
ui: {
widget: 'custom',
placeholder: '请输入',
errors: { required: '必填项' }
}
},
volume: {
type: 'string',
title: '',
ui: {
widget: 'custom',
placeholder: '请输入'
}
},
number: {
type: 'string',
title: '',
ui: {
widget: 'custom',
placeholder: '请输入'
}
},
carModel: {
type: 'string',
title: '车型/车长',
ui: {
widget: 'select',
mode: 'multiple',
maxMultipleCount:3,
placeholder: '请选择车型',
errors: { required: '请选择车型' },
asyncData: () => this.service.getDictOptions({ dictKey: 'car:model' }),
change:(tag:any , org:any)=>{
if(tag.includes("999")){
this.sf4.setValue('/carModel',["999"]);
}
}
}
},
carLength: {
type: 'string',
title: '',
ui: {
widget: 'select',
mode: 'multiple',
maxMultipleCount:3,
placeholder: '请选择车长',
errors: { required: '请选择车长' },
asyncData: () => this.service.getDictOptions({ dictKey: 'car:length' }),
change:(tag:any , org:any)=>{
if(tag.includes("999")){
this.sf4.setValue('/carModel',["999"]);
}
}
}
},
},
required: ['weight', 'carModel', 'carLength']
};
this.ui4 = {
'*': {
spanLabelFixed: 90,
grid: { span: 24 }
},
$weight: {
grid: { lg: 8, md: 12, sm: 12, xs: 24 }
},
$volume: {
grid: { lg: 8, md: 12, sm: 12, xs: 24 }
},
$number: {
grid: { lg: 8, md: 12, sm: 12, xs: 24 }
},
$carModel: {
spanLabelFixed: 100,
grid: { span: 8 }
},
$carLength: {
grid: { span: 8 }
}
};
}
changeGoodsType(value: string, data: any) { changeGoodsType(value: string, data: any) {
if (data.label === '其它') return; if (data.label === '其它') return;
const params = { const params = {
@ -745,165 +665,143 @@ changeGoodsType(value: string, data: any) {
} }
}); });
} }
// initSF4() { initSF4() {
// this.schema4 = { this.schema4 = {
// properties: { properties: {
// weight: { weight: {
// type: 'string', type: 'string',
// title: '货物数量', title: '货物数量',
// ui: { ui: {
// widget: 'custom', widget: 'custom',
// placeholder: '请输入', placeholder: '请输入',
// errors: { required: '必填项' } errors: { required: '必填项' }
// } }
// }, },
// volume: { carmand: {
// type: 'string', type: 'string',
// title: '', title: '用车需求',
// ui: { ui: {
// widget: 'custom', widget: 'custom',
// placeholder: '请输入' placeholder: '请输入'
// } }
// }, },
// number: { drivers: {
// type: 'string', type: 'string',
// title: '', title: '承运司机',
// ui: { ui: {
// widget: 'custom', widget: 'custom',
// placeholder: '请输入' placeholder: '请输入'
// } }
// }, },
// carmand: { weightModel: {
// type: 'string', type: 'string',
// title: '用车需求', title: '车型车长承重',
// ui: { ui: {
// widget: 'custom', widget: 'custom',
// placeholder: '请输入' placeholder: '请输入'
// } }
// }, },
// drivers: { loadTime: {
// type: 'string', type: 'string',
// title: '承运司机', title: '发车时间',
// ui: { ui: {
// widget: 'custom', widget: 'custom',
// placeholder: '请输入' placeholder: '请输入'
// } }
// }, },
// weightModel: { unloadTime: {
// type: 'string', type: 'string',
// title: '车型车长承重', title: '到车时间',
// ui: { ui: {
// widget: 'custom', widget: 'custom',
// placeholder: '请输入' placeholder: '请输入'
// } }
// }, },
// loadTime: { acceptWeight: {
// type: 'string', type: 'number',
// title: '发车时间', title: '装货重量',
// ui: { minimum:0,
// widget: 'custom', maximum:99999,
// placeholder: '请输入' ui: {
// } unit: '吨',
// }, placeholder: '请输入',
// unloadTime: { grid: {
// type: 'string', span: 12
// title: '到车时间', },
// ui: { hideStep: true,
// widget: 'custom', } as SFNumberWidgetSchema
// placeholder: '请输入' },
// } acceptVolume: {
// }, type: 'number',
// acceptWeight: { title: '装货体积',
// type: 'number', minimum:0,
// title: '装货重量', maximum:99999,
// minimum:0, ui: {
// maximum:99999, unit: '吨',
// ui: { placeholder: '请输入',
// unit: '吨', grid: {
// placeholder: '请输入', span: 12
// grid: { },
// span: 12 hideStep: true,
// }, } as SFNumberWidgetSchema
// hideStep: true, },
// } as SFNumberWidgetSchema settlementWeight: {
// }, type: 'number',
// acceptVolume: { title: '卸货重量',
// type: 'number', minimum:0,
// title: '装货体积', maximum:99999,
// minimum:0, ui: {
// maximum:99999, unit: '吨',
// ui: { placeholder: '请输入',
// unit: '吨', grid: {
// placeholder: '请输入', span: 12
// grid: { },
// span: 12 hideStep: true,
// }, } as SFNumberWidgetSchema
// hideStep: true, },
// } as SFNumberWidgetSchema settlementVolume: {
// }, type: 'number',
// settlementWeight: { title: '卸货体积',
// type: 'number', minimum:0,
// title: '卸货重量', maximum:99999,
// minimum:0, ui: {
// maximum:99999, unit: '吨',
// ui: { placeholder: '请输入',
// unit: '吨', grid: {
// placeholder: '请输入', span: 12
// grid: { },
// span: 12 hideStep: true,
// }, } as SFNumberWidgetSchema
// hideStep: true, }
// } as SFNumberWidgetSchema },
// }, required: ['loadTime','unloadTime']
// settlementVolume: { };
// type: 'number', this.ui4 = {
// title: '卸货体积', '*': {
// minimum:0, spanLabelFixed: 90,
// maximum:99999, grid: { span: 24 }
// ui: { },
// unit: '吨', $weight: {
// placeholder: '请输入', grid: { span: 24 }
// grid: { },
// span: 12 $carmand: {
// }, grid: { span: 24 }
// hideStep: true, },
// } as SFNumberWidgetSchema $weightModel: {
// } spanLabelFixed: 120,
// }, grid: { span: 12 }
// required: ['weight','loadTime','unloadTime'] },
// }; $drivers: {
// this.ui4 = { grid: { span: 12 }
// '*': { },
// spanLabelFixed: 90, $loadTime: {
// grid: { span: 24 } grid: { span: 12 }
// }, },
// $weight: { $unloadTime: {
// grid: { span: 8 } grid: { span: 12 }
// }, },
// $volume: { };
// grid: { span: 8 } }
// },
// $number: {
// grid: { span: 8 }
// },
// $carmand: {
// grid: { span: 24 }
// },
// $weightModel: {
// spanLabelFixed: 120,
// grid: { span: 12 }
// },
// $drivers: {
// grid: { span: 12 }
// },
// $loadTime: {
// grid: { span: 12 }
// },
// $unloadTime: {
// grid: { span: 12 }
// },
// };
// }
// 处理上传图片 // 处理上传图片
handlePreview1 = async (file: NzUploadFile) => { handlePreview1 = async (file: NzUploadFile) => {
if (!file.url && !file.preview) { if (!file.url && !file.preview) {
@ -970,4 +868,25 @@ goDistance(elf: NzCardComponent) {
elf['elementRef'].nativeElement.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'start' }); elf['elementRef'].nativeElement.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'start' });
} }
} }
// 装卸货地址互换
swapAddress() {
let item = this.startInfo;
this.startInfo = this.endInfo;
this.endInfo = item;
this.startInfo.forEach((element: any) => {
element.type = '1';
});
this.endInfo.forEach((element: any) => {
element.type = '2';
});
// 计算里程,时间
if (this.startInfo[0]?.area && this.endInfo[0]?.area) {
this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => {
this.totalDistance = res.distance;
this.totalTime = res.time;
});
}
}
} }

View File

@ -112,7 +112,8 @@
</div> </div>
<div nz-col [nzSpan]="4"> <div nz-col [nzSpan]="4">
<div style="display: flex; justify-content: center"> <div style="display: flex; justify-content: center">
<span style="padding: 24 px; font-size: 30px; color: #7d7d7d"><i nz-icon nzType="swap" nzTheme="outline"></i></span> <span class="swap-icon" (click)="swapAddress()"><i nz-icon nzType="swap"
nzTheme="outline"></i></span>
</div> </div>
</div> </div>
<div nz-col [nzSpan]="10"> <div nz-col [nzSpan]="10">

View File

@ -4,7 +4,7 @@
* @Author : Shiming * @Author : Shiming
* @Date : 2021-12-23 13:39:58 * @Date : 2021-12-23 13:39:58
* @LastEditors : Shiming * @LastEditors : Shiming
* @LastEditTime : 2022-03-04 10:45:54 * @LastEditTime : 2022-03-04 10:48:50
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\vehicle-detail-change\\vehicle-detail-change.component.ts * @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\vehicle-detail-change\\vehicle-detail-change.component.ts
* Copyright (C) 2022 huzhenhong. All rights reserved. * Copyright (C) 2022 huzhenhong. All rights reserved.
*/ */
@ -883,5 +883,41 @@ export class OrderManagementVehicleDetailChangeComponent implements OnInit {
} }
console.log(elf); console.log(elf);
} }
// 装卸货地址互换
swapAddress() {
this.startInfo.forEach((element: any, index: any) => {
this.validateForm1.removeControl(`loadAddress${index}`);
this.validateForm1.removeControl(`loadName${index}`);
this.validateForm1.removeControl(`loadPhone${index}`);
});
this.endInfo.forEach((element: any, index: any) => {
this.validateForm1.removeControl(`unloadAddress${index}`);
this.validateForm1.removeControl(`unloadName${index}`);
this.validateForm1.removeControl(`unloadPhone${index}`);
});
let item = this.startInfo;
this.startInfo = this.endInfo;
this.endInfo = item;
this.startInfo.forEach((element: any, index: any) => {
element.type = '1';
this.validateForm1.addControl(`loadAddress${index}`, new FormControl(null, Validators.required));
this.validateForm1.addControl(`loadName${index}`, new FormControl(null, Validators.required));
this.validateForm1.addControl(`loadPhone${index}`, new FormControl(null, [Validators.required, Validators.pattern('^[0-9]*$')]));
});
this.endInfo.forEach((element: any, index: any) => {
element.type = '2';
this.validateForm1.addControl(`unloadAddress${index}`, new FormControl(null, Validators.required));
this.validateForm1.addControl(`unloadName${index}`, new FormControl(null, Validators.required));
this.validateForm1.addControl(`unloadPhone${index}`, new FormControl(null, [Validators.required, Validators.pattern('^[0-9]*$')]));
});
// 计算里程,时间
if (this.startInfo[0]?.area && this.endInfo[0]?.area) {
this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => {
this.totalDistance = res.distance;
this.totalTime = res.time;
});
}
}
} }

View File

@ -1024,6 +1024,13 @@ export class SupplyManagementBulkPublishComponent implements OnInit {
if (this.PageStatus === '大宗修改') { if (this.PageStatus === '大宗修改') {
this.sf4data.id = res?.goodsInfoVOList[0]?.id; this.sf4data.id = res?.goodsInfoVOList[0]?.id;
} }
// 计算里程,时间
if (this.startInfo[0]?.area && this.endInfo[0]?.area) {
this.amapService.drivingCompute([...this.startInfo], [...this.endInfo]).subscribe(res => {
this.totalDistance = res.distance;
this.totalTime = res.time;
});
}
this.totalFees = res?.freightPrice || '0'; this.totalFees = res?.freightPrice || '0';
this.sf7data = { this.sf7data = {
stateReceipt: res?.stateReceipt, stateReceipt: res?.stateReceipt,