Merge branch 'develop' of https://gitlab.eascs.com/tms-ui/tms-obc-web into develop

This commit is contained in:
Taric Xin
2022-01-04 15:15:05 +08:00
12 changed files with 220 additions and 127 deletions

View File

@ -1,13 +1,13 @@
/*
* @Author: your name
* @Date: 2021-12-30 19:36:30
* @LastEditTime: 2021-12-31 13:50:41
* @LastEditors: your name
* @LastEditTime: 2022-01-04 10:34:31
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \tms-obc-web\src\app\routes\financial-management\services\freight-account.service.ts
*/
import { Injectable, Injector } from '@angular/core';
import { BaseService, ShipperBaseService } from '@shared';
import { BaseService, EACacheService, ShipperBaseService } from '@shared';
@Injectable({
providedIn: 'root'
@ -57,7 +57,7 @@ export class FreightAccountService extends ShipperBaseService {
// 根据费用头ID查询费用单及开票明细
$api_get_cost_detail = '/api/fcc/ficoFeeL/detail';
constructor(public injector: Injector) {
super(injector);
constructor(public injector: Injector,public eaCacheSrv: EACacheService) {
super(injector, eaCacheSrv);
}
}

View File

@ -627,16 +627,11 @@ resourceStatus: any;
nzContent: VehicleModifyRateComponent,
nzComponentParams: { data: { ids: params } },
nzFooter: null,
// nzOnOk: sin => {
// this.service.request(this.service.$api_change_bulk, { billId: item.id, ...sin.sf.value }).subscribe(res => {
// if (res) {
// this.service.msgSrv.success('变更运费成功');
// modal.destroy();
// this.st.reload();
// }
// });
// return false;
// }
});
modal.afterClose.subscribe((result) => {
if (result) {
this.st.load(1);
}
});
}
/**

View File

@ -1,7 +1,7 @@
<!--
* @Author: your name
* @Date: 2021-12-15 13:17:42
* @LastEditTime: 2021-12-29 15:12:09
* @LastEditTime: 2022-01-04 11:10:46
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \tms-obc-web\src\app\routes\order-management\modal\vehicle\update-freight\update-freight.component.html
@ -10,5 +10,5 @@
<sf style="margin-top: 15px;" #sf mode="edit" [schema]="schema" [ui]="ui" button="none"></sf>
<div class="modal-footer">
<button nz-button type="button" (click)="close()">关闭</button>
<button nz-button type="submit" nzType="primary" (click)="save(sf.value)" [disabled]="sf.valid">确定</button>
<button nz-button type="submit" nzType="primary" (click)="save(sf.value)" >确定</button>
</div>

View File

@ -2,7 +2,7 @@ import { preloaderFinished } from '@delon/theme';
/*
* @Author: your name
* @Date: 2021-12-14 14:03:07
* @LastEditTime: 2021-12-29 15:02:47
* @LastEditTime: 2022-01-04 11:21:29
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \tms-obc-web\src\app\routes\order-management\modal\bulk\update-freight\update-freight.component.ts
@ -42,17 +42,12 @@ export class VehicleModifyRateComponent implements OnInit {
ngOnInit(): void {
console.log(this.data)
this.initSF(this.data);
this.initSF();
}
initSF(data: any) {
const info = {
prePay: data.list?.filter((item: any) => item.costCode === 'PRE')[0],
toPay: data.list?.filter((item: any) => item.costCode === 'RECE')[0],
receiptPay: data.list?.filter((item: any) => item.costCode === 'BACK')[0]
};
initSF() {
this.schema = {
properties: {
prePay: {
additionalRate: {
type: 'number',
title: '附加费率',
ui: {
@ -62,7 +57,7 @@ export class VehicleModifyRateComponent implements OnInit {
} as SFNumberWidgetSchema
},
},
required: ['prePay']
required: ['additionalRate']
};
this.ui = {
'*': {
@ -73,14 +68,23 @@ export class VehicleModifyRateComponent implements OnInit {
}
save(value: any): void {
if(!this.sf.value?.additionalRate) {
this.service.msgSrv.warning('请填写附加费!')
return;
}
console.log(this.sf.value)
const params = {
};
ids: this.data?.ids,
...this.sf.value
this.service.request(this.service.$api_get_insertFreightChangeWhole, params).subscribe((res: any) => {
};
console.log(params)
this.service.request(this.service.$api_set_updateAdditionalRateBatch, params).subscribe((res: any) => {
if (res) {
this.modal.destroy();
this.modal.close(true);
this.service.msgSrv.success('变更运费成功');
} else {
this.service.msgSrv.error(res?.msg)
}
});
}

View File

@ -1,14 +1,14 @@
/*
* @Author: your name
* @Date: 2021-12-03 15:31:52
* @LastEditTime: 2022-01-04 09:32:27
* @LastEditTime: 2022-01-04 11:07:08
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \tms-obc-web\src\app\routes\order-management\services\order-management.service.ts
*/
import { Injectable, Injector } from '@angular/core';
import { map } from 'rxjs/operators';
import { ShipperBaseService } from '@shared';
import { EACacheService, ShipperBaseService } from '@shared';
@Injectable({
providedIn: 'root'
@ -103,6 +103,8 @@ export class OrderManagementService extends ShipperBaseService {
$api_set_getBulkOrderDetail = `/api/sdc/billOperate/getBulkOrderDetail`;
// 批量修改网络货运人
$api_set_updateEnterpriseInfoBatch = `/api/sdc/billOperate/updateEnterpriseInfoBatch`;
// 批量修改附加费率
$api_set_updateAdditionalRateBatch = `/api/sdc/billOperate/updateAdditionalRateBatch`;
@ -129,7 +131,7 @@ export class OrderManagementService extends ShipperBaseService {
})
);
}
constructor(public injector: Injector) {
super(injector)
constructor(public injector: Injector,public eaCacheSrv: EACacheService) {
super(injector,eaCacheSrv)
}
}

View File

@ -1,10 +1,11 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { Router } from '@angular/router';
import { STColumn, STComponent } from '@delon/abc/st';
import { SFComponent, SFDateWidgetSchema, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
import { SFComponent, SFDateWidgetSchema, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
import { ModalHelper, _HttpClient } from '@delon/theme';
import { ShipperBaseService } from '@shared';
import { NzModalService } from 'ng-zorro-antd/modal';
import { of } from 'rxjs';
import { map } from 'rxjs/operators';
import { SupplyManagementService } from '../../services/supply-management.service';
import { SupplyManagementQrcodePageComponent } from '../qrcode-page/qrcode-page.component';
@ -138,14 +139,29 @@ export class SupplyManagementBulkComponent implements OnInit {
asyncData: () => this.service2.getNetworkFreightForwarder(),
},
},
no4: {
shipperAppUserId: {
type: 'string',
title: '货主',
ui: {
widget: 'select',
serverSearch: true,
searchDebounceTime: 300,
searchLoadingText: '搜索中...',
visibleIf: {
_$expand: (value: boolean) => value,
_$expand: (value: boolean) => value
},
}
onSearch: (q: any) => {
console.log(q)
if (!!q) {
return this.service
.request(this.service.$api_enterpriceList, { enterpriseName: q})
.pipe(map((res: any) => (res as any[]).map((i) => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum))))
.toPromise();
} else {
return of([]);
}
},
} as SFSelectWidgetSchema,
},
},
type: 'object',

View File

@ -538,29 +538,35 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
}
};
}
payChange() {
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 => {
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;
} else {
this.service.msgSrv.error(res.msg);
}
});
} else {
this.service.msgSrv.error(res.msg);
}
});
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)
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) {
@ -922,10 +928,12 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
toPay: res?.shippingInformationVO?.toPay,
oilCardPay: res?.shippingInformationVO?.oilCardPay,
receiptPay: res?.shippingInformationVO?.receiptPay,
// subtotal: res?.shippingInformationVO?.oilCardPay ,
subtotal: res?.shippingInformationVO?.totalFee,
total: res?.shippingInformationVO?.totalFee,
appendFee: res?.shippingInformationVO?.appendFee,
paymentDays: res?.paymentDays
};
this.payChange(this.sf7data);
}
backBillChange() {
const modalRef = this.modalService.create({

View File

@ -1,7 +1,7 @@
import { ActivatedRoute, Router } from '@angular/router';
import { Component, OnInit, ViewChild } from '@angular/core';
import { STColumn, STComponent } from '@delon/abc/st';
import { SFComponent, SFSchema, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
import { SFComponent, SFSchema, SFSchemaEnum, SFSelectWidgetSchema, SFUISchema } from '@delon/form';
import { ModalHelper, _HttpClient } from '@delon/theme';
import { NzModalService } from 'ng-zorro-antd/modal';
import { map } from 'rxjs/operators';
@ -10,6 +10,8 @@ import { SupplyManagementVehicleAssignedCarComponent,
} from '../assigned-car/assigned-car.component';
import { SupplyManagementUpdateExternalSnComponent } from '../update-external-sn/update-external-sn.component';
import { SupplyManagementUpdateFreightComponent } from '../update-freight/update-freight.component';
import { of } from 'rxjs';
import { ShipperBaseService } from '@shared';
@Component({
selector: 'app-supply-management-vehicle',
@ -35,19 +37,28 @@ export class SupplyManagementVehicleComponent implements OnInit {
stayQuantity: 0
};
resourceStatus: any;
constructor(public service: SupplyManagementService, private modal: NzModalService, private router: Router, private ar: ActivatedRoute) {}
constructor(
public service: SupplyManagementService,
private modal: NzModalService,
private router: Router,
private ar: ActivatedRoute,
public shipperSrv: ShipperBaseService
) {}
/**
* 查询参数
*/
get reqParams() {
const a: any = {};
const params = Object.assign({}, this.sf?.value || {});
delete params._$expand;
const a: any = {
...params
};
if (this.resourceStatus) {
a.resourceStatus = this.resourceStatus;
}
return {
...a,
...this.sf?.value
};
}
get selectedRows() {
@ -262,26 +273,41 @@ export class SupplyManagementVehicleComponent implements OnInit {
title: '卸货地',
ui: { placeholder: '请输入' }
},
shipperAppUserName: {
shipperAppUserId: {
type: 'string',
title: '货主',
ui: {
widget: 'select',
serverSearch: true,
searchDebounceTime: 300,
searchLoadingText: '搜索中...',
visibleIf: {
_$expand: (value: boolean) => value
}
}
},
onSearch: (q: any) => {
console.log(q)
if (!!q) {
return this.service
.request(this.service.$api_enterpriceList, { enterpriseName: q})
.pipe(map((res: any) => (res as any[]).map((i) => ({ label: i.enterpriseName, value: i.id } as SFSchemaEnum))))
.toPromise();
} else {
return of([]);
}
},
} as SFSelectWidgetSchema,
},
goodsName: {
title: '所属项目',
enterpriseProjectId: {
type: 'string',
default: '',
title: '所属项目',
ui: {
widget: 'select',
visibleIf: {
_$expand: (value: boolean) => value
}
// asyncData: () =>[]
} as SFSelectWidgetSchema
_$expand: (value: boolean) => value,
},
asyncData: () =>
this.shipperSrv.getEnterpriseProject()
} as SFSelectWidgetSchema,
},
serviceType: {
title: '服务类型',
@ -306,17 +332,17 @@ export class SupplyManagementVehicleComponent implements OnInit {
}
} as SFSelectWidgetSchema
},
enterpriseInfoName: {
enterpriseInfoId: {
type: 'string',
title: '网络货运人',
ui: {
widget: 'select',
placeholder: '请选择',
asyncData: () => this.shipperSrv.getNetworkFreightForwarder(),
visibleIf: {
_$expand: (value: boolean) => value
},
allowClear: true
// asyncData: () => this.getCatalogueMember(),
}
}
}

View File

@ -1,7 +1,7 @@
/*
* @Author: your name
* @Date: 2021-12-03 11:10:14
* @LastEditTime: 2021-12-28 19:53:40
* @LastEditTime: 2022-01-04 13:27:16
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \tms-obc-web\src\app\routes\supply-management\services\supply-management.service.ts
@ -39,7 +39,7 @@ export class SupplyManagementService extends BaseService {
$api_get_catalogue_member = `/user?_allow_anonymous=true`;
$api_get_listModifyPrice = `/api/sdc/goodsInfo/listModifyPrice`;
$api_update_price = `/api/sdc/goodsInfo/modifyPrice`; // 根据货物ID修改单价
$api_get_goods_resource_statistical = `/api/sdc/goodsResourceOperate/StatisticalStatus`; // 统计整车、大宗货源状态数量
$api_get_goods_resource_statistical = `/api/sdc/goodsResourceOperate/statisticalStatus`; // 统计整车、大宗货源状态数量
// 获取货主企业列表
public $api_getList = '/api/mdc/cuc/enterpriseInfo/cargoOwner/getList?_allow_anonymous=true';
// 获取货主企业列表

View File

@ -1,13 +1,13 @@
/*
* @Author: your name
* @Date: 2021-12-29 13:12:35
* @LastEditTime: 2021-12-30 15:59:07
* @LastEditTime: 2022-01-04 10:36:02
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \tms-obc-web\src\app\routes\ticket-management\services\ticket.service.ts
*/
import { Injectable, Injector } from '@angular/core';
import { ShipperBaseService } from '@shared';
import { EACacheService, ShipperBaseService } from '@shared';
@Injectable({
providedIn: 'root'
@ -47,7 +47,7 @@ export class TicketService extends ShipperBaseService {
// 保存开票申请费用明细
$api_ficoVatappFee_save = '/api/fcc/ficoVatappFee/save';
constructor(public injector: Injector) {
super(injector);
constructor(public injector: Injector,public eaCacheSrv: EACacheService) {
super(injector, eaCacheSrv);
}
}

View File

@ -1,17 +1,17 @@
/*
* @Author: your name
* @Date: 2021-11-29 15:22:34
* @LastEditTime: 2021-12-13 11:25:12
* @LastEditTime: 2022-01-04 10:11:16
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \tms-obc-web\src\app\routes\usercenter\services\usercenter.service.ts
*/
import { Injectable, Injector } from '@angular/core';
import { cacheConf } from '@conf/cache.conf';
import { _HttpClient } from '@delon/theme';
import { ShipperBaseService } from '@shared';
import { EACacheService, ShipperBaseService } from '@shared';
import { NzModalService } from 'ng-zorro-antd/modal';
import { ImageViewComponent } from 'src/app/shared/components/imagelist';
@Injectable({
providedIn: 'root'
})
@ -106,8 +106,8 @@ export class UsermanageService extends ShipperBaseService {
// 身份证识别
$api_ocr_recognize_id_card = '/api/mdc/pbc/hwc/ocr/recognizeIdCard';
constructor(public injector: Injector, private nzModalService: NzModalService) {
super(injector);
constructor(public injector: Injector, private nzModalService: NzModalService, public eaCacheSrv: EACacheService) {
super(injector,eaCacheSrv);
}
showImg(url: any) {

View File

@ -1,14 +1,8 @@
/*
* @Author: your name
* @Date: 2021-12-29 17:20:03
* @LastEditTime: 2021-12-29 20:43:13
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \tms-obc-web\src\app\shared\services\business\shipper-base.service.ts
*/
import { Injectable, Injector } from '@angular/core';
import { BaseService } from '../core/base.service';
import { map } from 'rxjs/operators';
import { cacheConf } from '@conf/cache.conf';
import { EACacheService } from '..';
@Injectable({
providedIn: 'root'
@ -17,10 +11,13 @@ export class ShipperBaseService extends BaseService {
$api_get_carless_carrier = ``; // 获取承运人
$api_get_enterprise_project = `/api/mdc/cuc/enterpriseProject/getEnterpriseProjectList `; // 所属项目列表
$api_get_staff_list = `/api/mdc/cuc/userApp/getStaffList`; //查询企业项目员工列表(录单员)
$api_get_network_freight_forwarder = `/api/mdc/cuc/networkTransporter/findAll`; // 获取网络货运人
$api_get_network_freight_forwarder_list = `/api/mdc/cuc/networkTransporter/findAll`; // 获取网络货运人
$api_get_network_freight_forwarder_one = `/api/mdc/cuc/networkTransporter/get`; // 获取网络货运人
constructor(public injector: Injector) {
envCache: any;
constructor(public injector: Injector, public eaCacheSrv: EACacheService) {
super(injector);
this.envCache = this.eaCacheSrv.get(cacheConf.env);
}
/**
@ -28,19 +25,20 @@ export class ShipperBaseService extends BaseService {
* @returns
*/
getCarlessCarrier() {
return;
const params = {};
const params = {
};
return this.request(this.$api_get_carless_carrier, params, 'POST').pipe(
map(res => {
map((res) => {
if (res) {
res.map((m: any) => {
return { label: m.platformName, value: m.operationId };
});
}
})
}),
);
}
/**
* 获取所属项目
* @returns
@ -51,51 +49,95 @@ export class ShipperBaseService extends BaseService {
if (!res) {
return [];
}
const list = res.map((item: any) => ({
label: item.projectName,
value: item.enterpriseId
}));
return [{ value: '', label: '全部' }, ...list];
const list = res.map(((item: any) => {
return {
label: item.projectName,
value: item.enterpriseId
}
}))
const obj = [{ value: '', label: '全部' }];
return [...obj, ...list];
})
);
)
}
/**
* 获取录单员
* @returns
*/
getStaffList(params = {}) {
getStaffList(params = {},containerAll = true) {
return this.request(this.$api_get_staff_list, params).pipe(
map((res: any) => {
if (!res) {
return [];
}
const list = res.map((item: any) => ({
label: item.name,
value: item.userId
}));
return [{ value: '', label: '全部' }, ...list];
const list = res.map(((item: any) => {
return {
label: item.name,
value: item.userId
}
}))
const obj = [];
if (containerAll) {
obj.push({ label: '全部', value: '' })
}
return [...obj, ...list];
})
);
)
}
/**
* 获取网络货运人
/**
* 获取调度员
* @returns
*/
getNetworkFreightForwarder(params = {}) {
return this.request(this.$api_get_network_freight_forwarder, params).pipe(
getStaffList2(params = {}) {
return this.request(this.$api_get_staff_list, params).pipe(
map((res: any) => {
if (!res) {
return [];
}
const list = res.map(((item: any) => {
return {
label: `${item.name}/${item.telephone}`,
value: item.userId
}
}))
return [...list];
})
)
}
/**
* 获取网络货运人
* @returns
*/
getNetworkFreightForwarder(params = {}, containerAll = false) {
return this.request(this.$api_get_network_freight_forwarder_list, params).pipe(
map((res: any) => {
if (!res) {
return [];
}
const list = res.map((item: any) => ({
label: item.enterpriseName,
value: item.id
}));
return [{ value: '', label: '全部' }, ...list];
const list = res.map(((item: any) => {
return {
label: item.enterpriseName,
value: item.id
}
}))
const obj = [];
if (containerAll) {
obj.push({ label: '全部', value: '' })
}
return [...obj, ...list];
})
);
)
}
/**
* 根据ID获取网络货运人
* @returns
*/
getNetworkTransporterById(id: string) {
return this.request(this.$api_get_network_freight_forwarder_one, { id });
}
}