|
@@ -447,6 +447,143 @@ export default {
|
|
|
}
|
|
|
};
|
|
|
this.uploadInfo = '导入中...';
|
|
|
+ api.importExcelDataVerify(formData, header).then(res => {
|
|
|
+ if (res.data.code === '00020007') {
|
|
|
+ this.$confirm(`${res.data.msg}`, '提示1', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ api.importOperationRecord(formData, header).then(res => {
|
|
|
+ if (res.data.code === '00000001') {
|
|
|
+ this.$alert(`数据存在异常,导入失败,请修改后再试`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ // cancelButtonText: '取消',
|
|
|
+ // cancelButtonClass: 'cancelSure',
|
|
|
+ // confirmButtonClass: 'sure',
|
|
|
+ // customClass: 'exportConfirm',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {})
|
|
|
+ .catch(() => {});
|
|
|
+ this.getDataList(); // 重新获取列表
|
|
|
+ setTimeout(() => {
|
|
|
+ this.uploadInfo = '导入';
|
|
|
+ }, 300);
|
|
|
+ } else if (res.data.data === true && res.status === 200) {
|
|
|
+ this.$alert(`导入成功`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ // cancelButtonText: '取消',
|
|
|
+ // cancelButtonClass: 'cancelSure',
|
|
|
+ // confirmButtonClass: 'sure',
|
|
|
+ // customClass: 'exportConfirm',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ .then(() => {})
|
|
|
+ .catch(() => {});
|
|
|
+ this.getDataList(); // 重新获取列表
|
|
|
+ setTimeout(() => {
|
|
|
+ this.uploadInfo = '导入';
|
|
|
+ }, 300);
|
|
|
+ } else {
|
|
|
+ this.$alert(`${res.data.msg}`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ // // cancelButtonText: '取消',
|
|
|
+ // cancelButtonClass: 'cancelSure',
|
|
|
+ // confirmButtonClass: 'sure',
|
|
|
+ // customClass: 'exportConfirm',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {})
|
|
|
+ .catch(() => {});
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ this.uploadInfo = '导入';
|
|
|
+ }, 300);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.uploadInfo = '导入';
|
|
|
+ }, 300);
|
|
|
+ });
|
|
|
+ } else if (res.data.data === true) {
|
|
|
+ api.importOperationRecord(formData, header).then(res => {
|
|
|
+ if (res.data.code === '00000001') {
|
|
|
+ this.$alert(`数据存在异常,导入失败,请修改后再试`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ // cancelButtonText: '取消',
|
|
|
+ // cancelButtonClass: 'cancelSure',
|
|
|
+ // confirmButtonClass: 'sure',
|
|
|
+ // customClass: 'exportConfirm',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {})
|
|
|
+ .catch(() => {});
|
|
|
+ this.getDataList(); // 重新获取列表
|
|
|
+ setTimeout(() => {
|
|
|
+ this.uploadInfo = '导入';
|
|
|
+ }, 300);
|
|
|
+ } else if (res.data.data === true && res.status === 200) {
|
|
|
+ this.$alert(`导入成功`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ // cancelButtonText: '取消',
|
|
|
+ // cancelButtonClass: 'cancelSure',
|
|
|
+ // confirmButtonClass: 'sure',
|
|
|
+ // customClass: 'exportConfirm',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+ .then(() => {})
|
|
|
+ .catch(() => {});
|
|
|
+ this.getDataList(); // 重新获取列表
|
|
|
+ setTimeout(() => {
|
|
|
+ this.uploadInfo = '导入';
|
|
|
+ }, 300);
|
|
|
+ } else {
|
|
|
+ this.$alert(`${res.data.msg}`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ // // cancelButtonText: '取消',
|
|
|
+ // cancelButtonClass: 'cancelSure',
|
|
|
+ // confirmButtonClass: 'sure',
|
|
|
+ // customClass: 'exportConfirm',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {})
|
|
|
+ .catch(() => {});
|
|
|
+
|
|
|
+ setTimeout(() => {
|
|
|
+ this.uploadInfo = '导入';
|
|
|
+ }, 300);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ api.importExcelDataVerify(formData, header).then(res => {
|
|
|
+ if (res.data.code === '00020007') {
|
|
|
+ this.$confirm(`${res.data.msg}`, '提示1', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.importFusionRecord(formData,header)
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.uploadInfo = '导入';
|
|
|
+ }, 300);
|
|
|
+ });
|
|
|
+ } else if (res.data.data === true) {
|
|
|
+ this.importFusionRecord(formData,header)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ //解决上传相同文件不触发change
|
|
|
+ let inp = document.getElementById('upFile');
|
|
|
+ inp.value = '';
|
|
|
+ },
|
|
|
+ importFusionRecord(formData,header){
|
|
|
api.importFusionRecord(formData, header).then(res => {
|
|
|
if (res.data.code === '00000001') {
|
|
|
this.$alert(`数据存在异常,导入失败,请修改后再试`, '提示', {
|
|
@@ -495,9 +632,6 @@ export default {
|
|
|
}, 300);
|
|
|
}
|
|
|
});
|
|
|
- //解决上传相同文件不触发change
|
|
|
- let inp = document.getElementById('upFile');
|
|
|
- inp.value = '';
|
|
|
},
|
|
|
/********新增编辑弹窗**********/
|
|
|
showModal() {
|