|
@@ -123,7 +123,7 @@
|
|
|
v-if="testSuccess"
|
|
v-if="testSuccess"
|
|
|
type="button"
|
|
type="button"
|
|
|
class="btn btn-primary btn-primary-1 btn-primary-import"
|
|
class="btn btn-primary btn-primary-1 btn-primary-import"
|
|
|
- @click="runProcessImport(selectedDataTemplateNo)"
|
|
|
|
|
|
|
+ @click="runProcessImport"
|
|
|
>
|
|
>
|
|
|
{{ $t("lang.DataImportPanel.formalImport") }}
|
|
{{ $t("lang.DataImportPanel.formalImport") }}
|
|
|
</button>
|
|
</button>
|
|
@@ -146,12 +146,9 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <div class="row">
|
|
|
|
|
|
|
+ <div v-if="selectedDataTemplate.description != null" class="row">
|
|
|
<div>
|
|
<div>
|
|
|
- <div
|
|
|
|
|
- v-if="selectedDataTemplate != null"
|
|
|
|
|
- style="white-space: pre-wrap"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <div style="white-space: pre-wrap">
|
|
|
{{ selectedDataTemplate.description }}
|
|
{{ selectedDataTemplate.description }}
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
@@ -161,6 +158,7 @@
|
|
|
v-if="current === 2"
|
|
v-if="current === 2"
|
|
|
:columns="columns"
|
|
:columns="columns"
|
|
|
:data-source="dataSource"
|
|
:data-source="dataSource"
|
|
|
|
|
+ :extra-height="66"
|
|
|
>
|
|
>
|
|
|
<template #bodyCell="{ column, record }">
|
|
<template #bodyCell="{ column, record }">
|
|
|
<template v-if="column.key === 'ImportResult'">
|
|
<template v-if="column.key === 'ImportResult'">
|
|
@@ -253,6 +251,7 @@ export default {
|
|
|
columnCount: null, // 导入列数
|
|
columnCount: null, // 导入列数
|
|
|
testSuccess: false, // 测试导入是否成功
|
|
testSuccess: false, // 测试导入是否成功
|
|
|
isError: false,
|
|
isError: false,
|
|
|
|
|
+ batchNo: null, //批次号
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -616,6 +615,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
var importTableData = {
|
|
var importTableData = {
|
|
|
|
|
+ no: _self.selectedDataTemplateNo,
|
|
|
isForamlImport: isformalImport,
|
|
isForamlImport: isformalImport,
|
|
|
sheetIndex: sheetIndex,
|
|
sheetIndex: sheetIndex,
|
|
|
importTable: _self.importTable,
|
|
importTable: _self.importTable,
|
|
@@ -640,6 +640,7 @@ export default {
|
|
|
_self.showTestImportTable(data.dataList);
|
|
_self.showTestImportTable(data.dataList);
|
|
|
_self.uploadClassFile();
|
|
_self.uploadClassFile();
|
|
|
if (data.isSuccess) {
|
|
if (data.isSuccess) {
|
|
|
|
|
+ _self.batchNo = data.batchNo;
|
|
|
Notify.info(
|
|
Notify.info(
|
|
|
_self.$t('lang.Notify.success'),
|
|
_self.$t('lang.Notify.success'),
|
|
|
_self.$t('lang.DataImportPanel.describe5'),
|
|
_self.$t('lang.DataImportPanel.describe5'),
|
|
@@ -648,7 +649,8 @@ export default {
|
|
|
} else {
|
|
} else {
|
|
|
Notify.error(
|
|
Notify.error(
|
|
|
_self.$t('lang.Notify.fail'),
|
|
_self.$t('lang.Notify.fail'),
|
|
|
- _self.$t('lang.DataImportPanel.describe7') + `导入成功${data.successCount}条,导入失败${data.errorCount}条。`,
|
|
|
|
|
|
|
+ _self.$t('lang.DataImportPanel.describe7') +
|
|
|
|
|
+ `导入成功${data.successCount}条,导入失败${data.errorCount}条。`,
|
|
|
false,
|
|
false,
|
|
|
);
|
|
);
|
|
|
}
|
|
}
|
|
@@ -662,6 +664,7 @@ export default {
|
|
|
|
|
|
|
|
// 导出表格数据
|
|
// 导出表格数据
|
|
|
exportErrorExcel: function () {
|
|
exportErrorExcel: function () {
|
|
|
|
|
+ const _self = this;
|
|
|
const url = Common.getApiURL('dataImportResource/downloadTemplateExcel');
|
|
const url = Common.getApiURL('dataImportResource/downloadTemplateExcel');
|
|
|
const xhr = new XMLHttpRequest();
|
|
const xhr = new XMLHttpRequest();
|
|
|
xhr.open('get', url, true);
|
|
xhr.open('get', url, true);
|
|
@@ -674,14 +677,13 @@ export default {
|
|
|
let blob = new Blob([res]);
|
|
let blob = new Blob([res]);
|
|
|
const blobUrl = URL.createObjectURL(blob);
|
|
const blobUrl = URL.createObjectURL(blob);
|
|
|
const link = document.createElement('a');
|
|
const link = document.createElement('a');
|
|
|
- link.download = '数据.xlsx';
|
|
|
|
|
|
|
+ link.download = `${_self.selectedDataTemplate.dataTemplateName}.xlsx`;
|
|
|
link.style.display = 'none';
|
|
link.style.display = 'none';
|
|
|
link.href = blobUrl;
|
|
link.href = blobUrl;
|
|
|
document.body.appendChild(link);
|
|
document.body.appendChild(link);
|
|
|
link.click();
|
|
link.click();
|
|
|
URL.revokeObjectURL(blobUrl);
|
|
URL.revokeObjectURL(blobUrl);
|
|
|
document.body.removeChild(link);
|
|
document.body.removeChild(link);
|
|
|
- message.success('导出数据成功。');
|
|
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
xhr.send();
|
|
xhr.send();
|
|
@@ -726,14 +728,9 @@ export default {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
_self.dataSource = [];
|
|
_self.dataSource = [];
|
|
|
- let successCount = 0;
|
|
|
|
|
data.forEach(function (item) {
|
|
data.forEach(function (item) {
|
|
|
- if (item.ImportResult === '成功') {
|
|
|
|
|
- successCount += 1;
|
|
|
|
|
- }
|
|
|
|
|
_self.dataSource.push(item.data);
|
|
_self.dataSource.push(item.data);
|
|
|
});
|
|
});
|
|
|
- let errorCount = data.length - successCount;
|
|
|
|
|
// message
|
|
// message
|
|
|
const flag = _self.dataSource.every(item => {
|
|
const flag = _self.dataSource.every(item => {
|
|
|
return item.ImportResult === '成功';
|
|
return item.ImportResult === '成功';
|
|
@@ -750,7 +747,7 @@ export default {
|
|
|
/**
|
|
/**
|
|
|
* 点击正式导入、清空临时表按钮
|
|
* 点击正式导入、清空临时表按钮
|
|
|
*/
|
|
*/
|
|
|
- runProcessImport: function (selectedDataTemplateNo) {
|
|
|
|
|
|
|
+ runProcessImport: function () {
|
|
|
var _self = this;
|
|
var _self = this;
|
|
|
if (_self.lineCount <= 0) {
|
|
if (_self.lineCount <= 0) {
|
|
|
message.warning('请输入正确的导入行数!');
|
|
message.warning('请输入正确的导入行数!');
|
|
@@ -760,15 +757,10 @@ export default {
|
|
|
message.warning('请输入正确的导入列数!');
|
|
message.warning('请输入正确的导入列数!');
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- var no = selectedDataTemplateNo;
|
|
|
|
|
- const lineCount = _self.lineCount;
|
|
|
|
|
- const columnCount = _self.columnCount;
|
|
|
|
|
|
|
+ const no = _self.batchNo;
|
|
|
_self.loading = true;
|
|
_self.loading = true;
|
|
|
$.ajax({
|
|
$.ajax({
|
|
|
- url:
|
|
|
|
|
- Common.getApiURL('dataImportResource/formalDataImportByIds/') +
|
|
|
|
|
- no +
|
|
|
|
|
- `?lineCount=${lineCount}&columnCount=${columnCount}`,
|
|
|
|
|
|
|
+ url: Common.getApiURL('dataImportResource/formalDataImportByIds/') + no,
|
|
|
type: 'post',
|
|
type: 'post',
|
|
|
dataType: 'json',
|
|
dataType: 'json',
|
|
|
beforeSend: function (request) {
|
|
beforeSend: function (request) {
|
|
@@ -901,7 +893,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
.prevFixed {
|
|
.prevFixed {
|
|
|
position: fixed;
|
|
position: fixed;
|
|
|
- top: 93%;
|
|
|
|
|
|
|
+ top: 92%;
|
|
|
}
|
|
}
|
|
|
.btn-primary-1 {
|
|
.btn-primary-1 {
|
|
|
color: #fff;
|
|
color: #fff;
|
|
@@ -923,4 +915,7 @@ export default {
|
|
|
:deep(.ant-table-sticky-scroll) {
|
|
:deep(.ant-table-sticky-scroll) {
|
|
|
display: none !important;
|
|
display: none !important;
|
|
|
}
|
|
}
|
|
|
|
|
+.ant-divider-horizontal {
|
|
|
|
|
+ margin: 12px 0 !important;
|
|
|
|
|
+}
|
|
|
</style>
|
|
</style>
|