|
|
@@ -102,6 +102,19 @@
|
|
|
@current-change="pageCurrentChangeHandle">
|
|
|
</el-pagination>
|
|
|
</div>
|
|
|
+ <el-dialog title="爱心值导入结果" :visible.sync="loveValueImportResultVisible" width="900px" custom-class="love-value-import-result-dialog">
|
|
|
+ <div class="love-value-import-summary">成功导入{{ loveValueImportSuccessCount }}行,失败{{ loveValueImportFailures.length }}行</div>
|
|
|
+ <el-table :data="loveValueImportFailures" border max-height="420">
|
|
|
+ <el-table-column prop="parentName" label="家长姓名" min-width="120"></el-table-column>
|
|
|
+ <el-table-column prop="parentPhone" label="会员手机号" min-width="140"></el-table-column>
|
|
|
+ <el-table-column prop="memberName" label="家庭成员姓名" min-width="140"></el-table-column>
|
|
|
+ <el-table-column prop="loveValue" label="爱心值" min-width="90"></el-table-column>
|
|
|
+ <el-table-column label="错误原因" min-width="250">
|
|
|
+ <template #default="{ row }">第{{ row.rowNumber }}行:{{ row.reason }}</template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <span slot="footer" class="dialog-footer"><el-button type="primary" @click="loveValueImportResultVisible = false">知道了</el-button></span>
|
|
|
+ </el-dialog>
|
|
|
</el-card>
|
|
|
</template>
|
|
|
|
|
|
@@ -127,7 +140,10 @@ export default {
|
|
|
uploadUrl2: `${window.SITE_CONFIG['apiURL']}/core/love/value/record/import`,
|
|
|
uploadHeaders: {
|
|
|
token: Cookies.get('token')
|
|
|
- }
|
|
|
+ },
|
|
|
+ loveValueImportResultVisible: false,
|
|
|
+ loveValueImportSuccessCount: 0,
|
|
|
+ loveValueImportFailures: []
|
|
|
}
|
|
|
},
|
|
|
created () {
|
|
|
@@ -202,12 +218,9 @@ export default {
|
|
|
const data = response.data || {}
|
|
|
const failures = data.failures || []
|
|
|
if (failures.length > 0) {
|
|
|
- const details = failures.map(item => `第${item.rowNumber}行:${item.reason}`).join('<br>')
|
|
|
- this.$alert(`成功导入${data.successCount || 0}行,失败${data.failureCount || failures.length}行。<br>${details}`, '爱心值导入结果', {
|
|
|
- dangerouslyUseHTMLString: true,
|
|
|
- customClass: 'love-value-import-result-dialog',
|
|
|
- confirmButtonText: '知道了'
|
|
|
- })
|
|
|
+ this.loveValueImportSuccessCount = data.successCount || 0
|
|
|
+ this.loveValueImportFailures = failures
|
|
|
+ this.loveValueImportResultVisible = true
|
|
|
} else {
|
|
|
this.$message.success(`导入成功,共${data.successCount || 0}行!`)
|
|
|
}
|
|
|
@@ -257,7 +270,10 @@ export default {
|
|
|
|
|
|
<style lang="scss">
|
|
|
.love-value-import-result-dialog {
|
|
|
- width: 720px;
|
|
|
+ width: 900px;
|
|
|
+}
|
|
|
+.love-value-import-summary {
|
|
|
+ margin-bottom: 16px;
|
|
|
}
|
|
|
</style>
|
|
|
|