fix bug
This commit is contained in:
@ -4,7 +4,7 @@
|
||||
* @Author : Shiming
|
||||
* @Date : 2022-01-12 10:52:50
|
||||
* @LastEditors : Shiming
|
||||
* @LastEditTime : 2022-03-07 10:49:45
|
||||
* @LastEditTime : 2022-03-07 11:12:57
|
||||
* @FilePath : \\tms-obc-web\\src\\app\\routes\\order-management\\components\\bulk\\bulk.component.html
|
||||
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
||||
-->
|
||||
@ -72,8 +72,8 @@
|
||||
{{ item.freightPrice | currency }}
|
||||
</ng-template>
|
||||
<ng-template st-row="loadingTime" let-item let-index="index">
|
||||
<div *ngIf="item?.loadingTime">装 | {{ item?.loadingTime }}</div>
|
||||
<div *ngIf="item?.unloadingTime">卸 | {{ item?.unloadingTime }}</div>
|
||||
<div *ngIf="item?.loadTime">装 | {{ item?.loadTime }}</div>
|
||||
<div *ngIf="item?.unloadTime">卸 | {{ item?.unloadTime }}</div>
|
||||
</ng-template>
|
||||
<ng-template st-row="driverName" let-item let-index="index">
|
||||
<div> {{ item?.driverName }}/{{ item?.driverPhone }}/{{ item?.carNo }} </div>
|
||||
|
||||
@ -110,7 +110,7 @@
|
||||
<!-- 用车需求 -->
|
||||
<ng-template st-row="useCarDemand" let-item let-index="index">
|
||||
<div>车型: {{ item?.carModelLabel }}</div>
|
||||
<div class="error">车长: {{ item?.carLenghtLabel }} 米</div>
|
||||
<div class="error">车长: {{ item?.carLengthLabel }} 米</div>
|
||||
</ng-template>
|
||||
</st>
|
||||
</div>
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
* @Author : Shiming
|
||||
* @Date : 2022-01-12 10:52:50
|
||||
* @LastEditors : Shiming
|
||||
* @LastEditTime : 2022-03-04 09:57:16
|
||||
* @LastEditTime : 2022-03-07 11:13:39
|
||||
* @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\components\\vehicle\\vehicle.component.html
|
||||
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
||||
-->
|
||||
@ -90,7 +90,7 @@
|
||||
</ng-template>
|
||||
<ng-template st-row="useCarDemand" let-item let-index="index">
|
||||
<div>车型: {{ item?.carModelLabel }}</div>
|
||||
<div class="error">车长: {{ item?.carLenghtLabel }} 米</div>
|
||||
<div class="error">车长: {{ item?.carLengthLabel }} 米</div>
|
||||
</ng-template>
|
||||
</st>
|
||||
</div>
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
* @Author : Shiming
|
||||
* @Date : 2021-12-03 11:10:14
|
||||
* @LastEditors : Shiming
|
||||
* @LastEditTime : 2022-03-02 20:29:46
|
||||
* @LastEditTime : 2022-03-07 11:03:11
|
||||
* @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\model\\import-supply\\import-supply.component.html
|
||||
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
||||
-->
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
* @Author : Shiming
|
||||
* @Date : 2022-03-01 15:13:03
|
||||
* @LastEditors : Shiming
|
||||
* @LastEditTime : 2022-03-02 20:57:36
|
||||
* @LastEditTime : 2022-03-07 11:09:33
|
||||
* @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\model\\import-supply\\import-supply.component.ts
|
||||
* Copyright (C) 2022 huzhenhong. All rights reserved.
|
||||
*/
|
||||
@ -27,11 +27,11 @@ import { apiConf } from '@conf/api.conf';
|
||||
export class SupplyManagementImportSupplyComponent implements OnInit {
|
||||
record: any = {};
|
||||
files: any;
|
||||
fileName: any;
|
||||
status: boolean = true
|
||||
files2: any;
|
||||
schema: SFSchema = {};
|
||||
ui: SFUISchema = {};
|
||||
fileName: any;
|
||||
uploadUrl = apiConf.file_upload_url;
|
||||
@ViewChild('sf', { static: false }) sf!: SFComponent;
|
||||
constructor(
|
||||
@ -113,14 +113,13 @@ export class SupplyManagementImportSupplyComponent implements OnInit {
|
||||
};
|
||||
this.ui = {
|
||||
'*': {
|
||||
spanLabelFixed: 130,
|
||||
grid: { span: 20 },
|
||||
},
|
||||
'$fileName': {
|
||||
spanLabelFixed: 130,
|
||||
grid: { span: 20 },
|
||||
},
|
||||
'$resourceCode': {
|
||||
'$file': {
|
||||
spanLabelFixed: 130,
|
||||
grid: { span: 20 },
|
||||
},
|
||||
@ -154,13 +153,21 @@ export class SupplyManagementImportSupplyComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
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('保存成功');
|
||||
// this.modal.close(true);
|
||||
// }
|
||||
// });
|
||||
const formData = new FormData();
|
||||
this.files.forEach((file: any) => {
|
||||
formData.append('file', file);
|
||||
});
|
||||
console.log(formData)
|
||||
let params = { file: formData ,...this.sf.value}
|
||||
console.log(params)
|
||||
this.service.request(this.service.$api_goodsResourceOperateImport, params).subscribe(res => {
|
||||
if (res) {
|
||||
this.service.msgSrv.success('导入成功');
|
||||
this.modal.destroy({ ...res });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
close(): void {
|
||||
@ -171,6 +178,7 @@ export class SupplyManagementImportSupplyComponent implements OnInit {
|
||||
case 'uploading':
|
||||
break;
|
||||
case 'done':
|
||||
console.log(info);
|
||||
let file = info?.file;
|
||||
let fileName = file?.response.name;
|
||||
this.sf?.setValue('/fileName', fileName);
|
||||
@ -182,30 +190,17 @@ export class SupplyManagementImportSupplyComponent implements OnInit {
|
||||
}
|
||||
}
|
||||
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;
|
||||
// }
|
||||
// tslint:disable-next-line: no-non-null-assertion
|
||||
const isLt2M = file.size! / 1024 / 1024 < 3;
|
||||
if (!isLt2M) {
|
||||
this.service.msgSrv.warning('图片大小超过3兆!');
|
||||
observer.complete();
|
||||
return;
|
||||
}
|
||||
observer.next(isLt2M);
|
||||
observer.complete();
|
||||
});
|
||||
let fileName = file?.name;
|
||||
this.files = [];
|
||||
this.files.push(file);
|
||||
this.sf?.setValue('/fileName', fileName);
|
||||
return false;
|
||||
};
|
||||
clearFile() {
|
||||
this.fileName = null;
|
||||
this.sf?.setValue('/fileName', null);
|
||||
this.sf?.setValue('/file', null);
|
||||
}
|
||||
downFile() {
|
||||
this.service.downloadFile(this.service.$api_exportGoodsResourceOperateTemplate);
|
||||
}
|
||||
clearFile() {
|
||||
this.fileName = null;
|
||||
this.sf?.setValue('/fileName', null);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user