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

This commit is contained in:
Taric Xin
2022-03-03 10:05:52 +08:00
6 changed files with 85 additions and 98 deletions

View File

@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2022-01-12 10:52:50
* @LastEditors : Shiming
* @LastEditTime : 2022-03-01 13:13:29
* @LastEditTime : 2022-03-02 18:09:01
* @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\components\\bulk\\bulk.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
@ -52,7 +52,7 @@
<nz-tabset (nzSelectedIndexChange)="selectChange($event)" [nzTabBarExtraContent]="extraTemplate">
<nz-tab [nzTitle]="'全部(' + tabs?.totalQuantity + ')'"></nz-tab>
<nz-tab [nzTitle]="'进行中(' + tabs?.stayQuantity + ')'"></nz-tab>
<nz-tab [nzTitle]="'已完结(' + tabs?.receivedQuantity + ')'"></nz-tab>
<nz-tab [nzTitle]="'已完结(' + tabs?.completedQuantity + ')'"></nz-tab>
<nz-tab [nzTitle]="'已取消(' + tabs?.cancelQuantity + ')'"></nz-tab>
</nz-tabset>
<div style="position: relative">

View File

@ -36,7 +36,7 @@ export class SupplyManagementBulkComponent implements OnInit {
tabs = {
totalQuantity: 0,
cancelQuantity: 0,
receivedQuantity: 0,
completedQuantity: 0,
stayQuantity: 0
};
constructor(
@ -393,7 +393,11 @@ export class SupplyManagementBulkComponent implements OnInit {
selectChange(e: number) {
console.log(e);
if(e == 2) {
this.resourceStatus = 4;
} else {
this.resourceStatus = e;
}
this.initST();
setTimeout(() => {
this.st.load(1);
@ -553,7 +557,7 @@ export class SupplyManagementBulkComponent implements OnInit {
this.tabs = {
totalQuantity: 0,
cancelQuantity: 0,
receivedQuantity: 0,
completedQuantity: 0,
stayQuantity: 0
};
const params: any = Object.assign({}, this.reqParams || {});

View File

@ -153,7 +153,6 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
searchDebounceTime: 300,
searchLoadingText: '搜索中...',
onSearch: (q: any) => {
console.log(q === ' ');
let str = q.replace(/^\s+|\s+$/g, '');
if (str) {
return this.service
@ -690,7 +689,6 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
};
}
getRegionCode(regionCode: any) {
console.log(regionCode);
return this.service
.request(this.service.$api_get_enterprise_project, { id: regionCode })
.pipe(
@ -715,13 +713,6 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
const receiptPay = this.sf7.value.receiptPay || 0;
const oilCardPay = 0;
const subtotal = prePay + toPay + receiptPay;
console.log(this?.sf1.value?.enterpriseInfoName);
if (this?.sf1.value?.enterpriseInfoName) {
console.log('5555');
}
console.log(this?.sf1.value?.enterpriseInfoId);
console.log(this?.sf1data?.enterpriseInfoId);
console.log(this?.sf1?.value?.enterpriseInfoName ? this?.sf1?.value?.enterpriseInfoName : this?.sf1data?.enterpriseInfoId || '');
const params = {
shipperId: this?.sf1?.value?.shipperAppUserId,
enterpriseInfoId: this?.sf1data?.enterpriseInfoId || '',
@ -731,12 +722,10 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
};
this.service.request(this.service.$api_getCalculatedSurcharge, params).subscribe(res => {
if (res) {
console.log(res);
this.sf7.setValue('/appendFee', res.surcharge);
this.sf7.setValue('/subtotal', subtotal);
this.sf7.setValue('/total', subtotal + res.surcharge);
let items = this?.sf1data?.enterpriseInfoId || '';
console.log(items);
this.service
.request(
this.service.$api_getAdditionalRate +
@ -985,9 +974,8 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
{ expenseCode: 'RECE', expenseName: '到付', price: this.sf7.value.toPay || 0, id: this.sf7data?.toPayId || '' },
{ expenseCode: 'BACK', expenseName: '回单付', price: this.sf7.value.receiptPay || 0, id: this.sf7data?.receiptPayId || '' }
];
// 从“再下一单”过来将所有的子参数内的id都删除
if ((this.PageStatus = '整车下一单')) {
if ((this.PageStatus === '整车下一单')) {
LoadingList.forEach((ele: any) => {
delete ele.id;
});
@ -1010,7 +998,6 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
expenseDTOList: expenseList,
paymentDays: this.sf7.value.paymentDays
};
const modalRef = this.modalService.create({
nzTitle: '运输协议',
nzContent: TranAgreementComponent,
@ -1026,24 +1013,6 @@ export class SupplyManagementOnecarPublishComponent implements OnInit {
}
// 提交
submit(submitType?: string, params?: any): void {
// const params: any = {
// ...this.sf1.value,
// ...this.sf5.value,
// ...this.sf6.value,
// paymentDays: this.sf7.value.paymentDays,
// loadingTime: this.loadingTime,
// unloadingTime: this.unloadingTime,
// unLoadingPlaceDTOList: [...this.startInfo, ...this.endInfo],
// goodsInfoDTOList: [
// {
// ...this.sf4.value,
// ...this.sf3.value,
// carModel: this.sf4.value.carModel.join(','),
// carLength: this.sf4.value.carLength.join(',')
// }
// ]
// };
console.log(params);
if (submitType) {
if (submitType == 'assign') {
this.chooseFamifiar(params);

View File

@ -4,42 +4,47 @@
* @Author : Shiming
* @Date : 2021-12-03 11:10:14
* @LastEditors : Shiming
* @LastEditTime : 2022-03-02 09:46:36
* @LastEditTime : 2022-03-02 20:29:46
* @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\model\\import-supply\\import-supply.component.html
* Copyright (C) 2022 huzhenhong. All rights reserved.
-->
<div *ngIf="status">
<sf #sf mode="edit" [schema]="schema" [ui]="ui" button="none">
<ng-template sf-template="resourceCode2" let-me let-ui="ui" let-schema="schema">
<input readonly nz-input placeholder="请选择上传文件" [(ngModel)]="files2" />
<nz-upload
[nzAction]="service.$api_upload_url"
[nzName]="'multipartFile'"
[nzHeaders]="{ authorization: 'authorization-text' }"
<ng-template sf-template="fileName" let-me let-ui="ui" let-schema="schema">
<nz-input-group [nzSuffix]="inputClearTpl">
<input type="text" readonly nz-input [(ngModel)]="me.formProperty.value" placeholder="请上传文件" />
</nz-input-group>
<ng-template #inputClearTpl>
<i nz-icon class="ant-input-clear-icon" nzTheme="fill" nzType="close-circle" *ngIf="me.formProperty.value"
(click)="clearFile()"></i>
</ng-template>
</ng-template>
<ng-template sf-template="file" let-me let-ui="ui" let-schema="schema">
<nz-upload [nzAction]="uploadUrl" [nzName]="'multipartFile'" [nzHeaders]="{ authorization: 'authorization-text' }"
[(nzFileList)]="files"
(nzChange)="handleChange($event)"
[nzShowUploadList]="false"
[nzBeforeUpload]="beforeUpload"
>
[nzAccept]="'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel'"
(nzChange)="handleChange($event)" [nzShowUploadList]="false" [nzBeforeUpload]="beforeUpload" [nzLimit]="1">
<div>
<button nz-button style="color: #ff4d4f; margin-top: 5px">
<button nzType="primary" nz-button>
<i nz-icon nzType="upload"></i>
上传文件
</button>
</div>
</nz-upload>
<span style="color: #ff4d4f; font-size: 12px;margin-left: 10px; cursor: pointer;" (click)="downFile()">下载导入模板</span>
<div style="color: #ff4d4f; font-size: 12px; margin-top: 5px; width: 400px">仅支持XLX / XLSX文件格式最多不能超过100行数据</div>
<span style="color: #ff4d4f; font-size: 12px;margin-left: 10px; cursor: pointer;"
(click)="downFile()">下载导入模板</span>
<div style="color: #ff4d4f; font-size: 12px; margin-top: 5px; width: 400px">仅支持XLS / XLSX文件格式最多不能超过100行数据</div>
</ng-template>
</sf>
<sv-container col="1" >
<sv style="height: 20px;">注意:</sv>
<sv style="height: 20px;">1、第一次上传请点击下载模板</sv>
<sv style="height: 20px;">2、请不要调整模板顺序</sv>
<sv style="height: 20px;">3、必填字段请务必填写</sv>
<sv style="height: 20px;">4、如果不清楚字段值请参考货源发布功能</sv>
<sv style="height: 20px;">5、发布成功后可在货源列表-待接单查看</sv>
</sv-container>
<div>
<p class="mb-xs">注意:</p>
<p class="mb-xs">1、第一次上传请点击下载模板</p>
<p class="mb-xs">2、请不要调整模板顺序</p>
<p class="mb-xs">3、必填字段请务必填写</p>
<p class="mb-xs">4、如果不清楚字段值请参考货源发布功能</p>
<p class="mb-xs">5、发布成功后可在货源列表-待接单查看</p>
<div>
</div>
<div *ngIf="!status">
文件上传成功成功xx条失败xx条

View File

@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2022-03-01 15:13:03
* @LastEditors : Shiming
* @LastEditTime : 2022-03-02 10:32:15
* @LastEditTime : 2022-03-02 20:57:36
* @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\model\\import-supply\\import-supply.component.ts
* Copyright (C) 2022 huzhenhong. All rights reserved.
*/
@ -18,6 +18,7 @@ import { NzUploadChangeParam, NzUploadFile } from 'ng-zorro-antd/upload';
import { Observable, Observer, of } from 'rxjs';
import { map } from 'rxjs/operators';
import { SupplyManagementService } from '../../services/supply-management.service';
import { apiConf } from '@conf/api.conf';
@Component({
selector: 'app-supply-management-import-supply',
@ -30,6 +31,8 @@ export class SupplyManagementImportSupplyComponent implements OnInit {
files2: any;
schema: SFSchema = {};
ui: SFUISchema = {};
fileName: any;
uploadUrl = apiConf.file_upload_url;
@ViewChild('sf', { static: false }) sf!: SFComponent;
constructor(
private modal: NzModalRef,
@ -70,17 +73,18 @@ export class SupplyManagementImportSupplyComponent implements OnInit {
let str =q.replace(/^\s+|\s+$/g,"");
if (str) {
this.getRegionCode(str);
this.getRegionCode2(str);
}
}
} as SFSelectWidgetSchema
},
resourceCode: {
netTranName: {
type: 'string',
title: '网络货运人',
ui: {
widget: 'select',
placeholder: '请选择'
} as SFSelectWidgetSchema
widget: 'text',
},
default: '确认货主后带出'
},
enterpriseProjectId: {
type: 'string',
@ -90,21 +94,29 @@ export class SupplyManagementImportSupplyComponent implements OnInit {
placeholder: '请选择'
} as SFSelectWidgetSchema
},
resourceCode2: {
fileName: {
type: 'string',
title: '导入货源信息',
ui: {
widget: 'custom'
}
},
file: {
type: 'string',
title: '',
ui: {
widget: 'custom'
}
},
},
required: ['shipperAppUserId', 'enterpriseProjectId','resourceCode2',],
required: ['shipperAppUserId', 'enterpriseProjectId','netTranName','fileName'],
};
this.ui = {
'*': {
spanLabelFixed: 130,
grid: { span: 20 },
},
'$resourceCode2': {
'$fileName': {
spanLabelFixed: 130,
grid: { span: 20 },
},
@ -134,22 +146,15 @@ export class SupplyManagementImportSupplyComponent implements OnInit {
getRegionCode2(regionCode: any) {
console.log(regionCode);
return this.service
.request(this.service.$api_getNetworkTransporter, { id: regionCode })
.pipe(
map(res =>
res.map((item: any) => ({
label: item.projectName,
value: item.id
}))
)
)
.subscribe(res => {
// this.sf.getProperty('/enterpriseProjectId')!.schema.enum = res;
// this.sf.getProperty('/enterpriseProjectId')!.widget.reset(res);
.request(this.service.$api_getNetworkTransporter, { id: regionCode }).subscribe((res: any) => {
console.log(res?.netTranName)
console.log(res?.networkTransporter)
this.sf.getProperty('/netTranName')!.widget.reset(res?.netTranName);
this.sf.setValue('/netTranName', res?.netTranName)
});
}
save(): void {
console.log(this.files)
console.log(this.sf.value)
// this.service.request(this.service.$api_update_price, { id, freightType, freightPrice, resourceCode, rule, resourceId }).subscribe(res => {
// if (res) {
// this.msgSrv.success('保存成功');
@ -162,33 +167,28 @@ export class SupplyManagementImportSupplyComponent implements OnInit {
this.modal.destroy();
}
handleChange(info: NzUploadChangeParam): void {
switch (info.file.status) {
switch (info?.file?.status) {
case 'uploading':
break;
case 'done':
let fileList = [...info.fileList];
// 2. Read from response and show file link
fileList = fileList.map((file: any) => {
if (file.response) {
file.url = file.response.data.fullFilePath;
}
return file;
});
this.files2 = fileList[0].name
let file = info?.file;
let fileName = file?.response.name;
this.sf?.setValue('/fileName', fileName);
this.sf?.setValue('/file', file?.response?.url);
break;
case 'error':
this.service.msgSrv.error('网络错误');
this.service.msgSrv.error('错误');
break;
}
}
beforeUpload = (file: NzUploadFile, _fileList: NzUploadFile[]) => {
return new Observable((observer: Observer<boolean>) => {
const isJpgOrPng = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
if (!isJpgOrPng) {
this.service.msgSrv.error('仅支持XLX / XLSX文件格式');
observer.complete();
return;
}
// const isJpgOrPng = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
// if (!isJpgOrPng) {
// this.service.msgSrv.error('仅支持XLX / XLSX文件格式');
// observer.complete();
// return;
// }
// tslint:disable-next-line: no-non-null-assertion
const isLt2M = file.size! / 1024 / 1024 < 3;
if (!isLt2M) {
@ -196,10 +196,15 @@ export class SupplyManagementImportSupplyComponent implements OnInit {
observer.complete();
return;
}
observer.next(isJpgOrPng && isLt2M);
observer.next(isLt2M);
observer.complete();
});
};
clearFile() {
this.fileName = null;
this.sf?.setValue('/fileName', null);
this.sf?.setValue('/file', null);
}
downFile() {
this.service.downloadFile(this.service.$api_exportGoodsResourceOperateTemplate);
}

View File

@ -9,5 +9,9 @@ export const apiConf = {
/**
* 文件上传路径(水印)
*/
waterFileUpload: `/api/mdc/pbc/upload/multipartFile/watermarkFile`
waterFileUpload: `/api/mdc/pbc/upload/multipartFile/watermarkFile`,
/**
* 上传文件返回fileModel
*/
file_upload_url: '/api/mdc/pbc/upload/multipartFile/fileModel'
};