zhanbo.xu

feat: 修改file逻辑

...@@ -847,7 +847,6 @@ ...@@ -847,7 +847,6 @@
847 <script> 847 <script>
848 import { 848 import {
849 addCustomerData, 849 addCustomerData,
850 - uploadCertificate,
851 uploadQingdaoCertificate, 850 uploadQingdaoCertificate,
852 updateCustomerData, 851 updateCustomerData,
853 delCertificate, 852 delCertificate,
...@@ -1156,7 +1155,8 @@ export default { ...@@ -1156,7 +1155,8 @@ export default {
1156 reader.onload = (e) => { 1155 reader.onload = (e) => {
1157 console.log(e); 1156 console.log(e);
1158 let obj = { 1157 let obj = {
1159 - file: e.target.result, 1158 + // file: e.target.result,
1159 + file: this.extractBase64(e.target.result),
1160 name: file.name, 1160 name: file.name,
1161 }; 1161 };
1162 this.formData.file = obj; 1162 this.formData.file = obj;
...@@ -1319,15 +1319,15 @@ export default { ...@@ -1319,15 +1319,15 @@ export default {
1319 addCustomerData(val) 1319 addCustomerData(val)
1320 .then((res) => { 1320 .then((res) => {
1321 if (res.code === "200") { 1321 if (res.code === "200") {
1322 - if (this.formData.file) { 1322 + // if (this.formData.file) {
1323 - this.uploadCertificate( 1323 + // this.uploadCertificate(
1324 - val.ecomEntCode, 1324 + // val.ecomEntCode,
1325 - this.base64ConvertFile( 1325 + // this.base64ConvertFile(
1326 - this.formData.file.file, 1326 + // this.formData.file.file,
1327 - this.formData.file.name 1327 + // this.formData.file.name
1328 - ) 1328 + // )
1329 - ); 1329 + // );
1330 - } 1330 + // }
1331 if (this.formData.qingdaoFile) { 1331 if (this.formData.qingdaoFile) {
1332 this.uploadQingdaoCertificate( 1332 this.uploadQingdaoCertificate(
1333 val.ecomEntCode, 1333 val.ecomEntCode,
...@@ -1349,22 +1349,22 @@ export default { ...@@ -1349,22 +1349,22 @@ export default {
1349 this.loadings.dialogLoading = false; 1349 this.loadings.dialogLoading = false;
1350 }); 1350 });
1351 }, 1351 },
1352 - uploadCertificate(ecomEntCode, file) { 1352 + // uploadCertificate(ecomEntCode, file) {
1353 - uploadCertificate(ecomEntCode, file) 1353 + // uploadCertificate(ecomEntCode, file)
1354 - .then((uploadRes) => { 1354 + // .then((uploadRes) => {
1355 - if (uploadRes.code === "200") { 1355 + // if (uploadRes.code === "200") {
1356 - // this.msgSuccess("客户添加和证书上传成功!"); 1356 + // // this.msgSuccess("客户添加和证书上传成功!");
1357 - this.close(true); 1357 + // this.close(true);
1358 - } else { 1358 + // } else {
1359 - this.alertWarningMsg(uploadRes.message); 1359 + // this.alertWarningMsg(uploadRes.message);
1360 - } 1360 + // }
1361 - this.loadings.dialogLoading = false; 1361 + // this.loadings.dialogLoading = false;
1362 - }) 1362 + // })
1363 - .catch((err) => { 1363 + // .catch((err) => {
1364 - console.log(err); 1364 + // console.log(err);
1365 - this.loadings.dialogLoading = false; 1365 + // this.loadings.dialogLoading = false;
1366 - }); 1366 + // });
1367 - }, 1367 + // },
1368 1368
1369 uploadQingdaoCertificate(ecomEntCode, file) { 1369 uploadQingdaoCertificate(ecomEntCode, file) {
1370 uploadQingdaoCertificate(ecomEntCode, file) 1370 uploadQingdaoCertificate(ecomEntCode, file)
...@@ -1387,15 +1387,15 @@ export default { ...@@ -1387,15 +1387,15 @@ export default {
1387 updateCustomerData(val) 1387 updateCustomerData(val)
1388 .then((res) => { 1388 .then((res) => {
1389 if (res.code === "200") { 1389 if (res.code === "200") {
1390 - if (this.formData.file) { 1390 + // if (this.formData.file) {
1391 - this.uploadCertificate( 1391 + // this.uploadCertificate(
1392 - val.ecomEntCode, 1392 + // val.ecomEntCode,
1393 - this.base64ConvertFile( 1393 + // this.base64ConvertFile(
1394 - this.formData.file.file, 1394 + // this.formData.file.file,
1395 - this.formData.file.name 1395 + // this.formData.file.name
1396 - ) 1396 + // )
1397 - ); 1397 + // );
1398 - } 1398 + // }
1399 if (this.formData.qingdaoFile) { 1399 if (this.formData.qingdaoFile) {
1400 this.uploadQingdaoCertificate( 1400 this.uploadQingdaoCertificate(
1401 val.ecomEntCode, 1401 val.ecomEntCode,
......