This commit is contained in:
wangshiming
2022-03-07 14:01:53 +08:00
parent 60b101f2bb
commit 02014f4b21
5 changed files with 52 additions and 19 deletions

View File

@ -4,7 +4,7 @@
* @Author : Shiming
* @Date : 2022-03-01 15:13:03
* @LastEditors : Shiming
* @LastEditTime : 2022-03-07 11:09:33
* @LastEditTime : 2022-03-07 13:50:55
* @FilePath : \\tms-obc-web\\src\\app\\routes\\supply-management\\model\\import-supply\\import-supply.component.ts
* Copyright (C) 2022 huzhenhong. All rights reserved.
*/
@ -32,6 +32,7 @@ export class SupplyManagementImportSupplyComponent implements OnInit {
files2: any;
schema: SFSchema = {};
ui: SFUISchema = {};
networkTransporter: any; // 网络货运人id
uploadUrl = apiConf.file_upload_url;
@ViewChild('sf', { static: false }) sf!: SFComponent;
constructor(
@ -78,7 +79,7 @@ export class SupplyManagementImportSupplyComponent implements OnInit {
}
} as SFSelectWidgetSchema
},
netTranName: {
enterpriseInfoId: {
type: 'string',
title: '网络货运人',
ui: {
@ -109,7 +110,7 @@ export class SupplyManagementImportSupplyComponent implements OnInit {
}
},
},
required: ['shipperAppUserId', 'enterpriseProjectId','netTranName','fileName'],
required: ['shipperAppUserId', 'enterpriseProjectId','enterpriseInfoId','fileName'],
};
this.ui = {
'*': {
@ -146,23 +147,22 @@ export class SupplyManagementImportSupplyComponent implements OnInit {
console.log(regionCode);
return this.service
.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)
console.log(res)
this.networkTransporter = res.networkTransporter
this.sf.getProperty('/enterpriseInfoId')!.widget.reset(res?.netTranName);
this.sf.setValue('/enterpriseInfoId', res?.netTranName)
});
}
save(): void {
console.log(this.files)
console.log(this.sf.value)
const formData = new FormData();
const formData : any= new FormData();
this.files.forEach((file: any) => {
formData.append('file', file);
formData.append('shipperAppUserId', this.sf.value?.shipperAppUserId);
formData.append('enterpriseInfoId', this?.networkTransporter);
formData.append('enterpriseProjectId', this.sf.value?.enterpriseProjectId);
});
console.log(formData)
let params = { file: formData ,...this.sf.value}
console.log(params)
this.service.request(this.service.$api_goodsResourceOperateImport, params).subscribe(res => {
this.service.request(this.service.$api_goodsResourceOperateImport, formData).subscribe(res => {
if (res) {
this.service.msgSrv.success('导入成功');
this.modal.destroy({ ...res });