epmet pc工作端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

218 lines
6.4 KiB

<template>
<div class="">
<div class="content_box">
<div class="left">
<img class="rotate" src="@/assets/images/index/loading.png" alt="" />
<p>请您耐心等待如果您发现导入数据问题较多可以取消导入</p>
<div>
<el-button
style="margin-left: 10px"
size="small"
type="primary"
@click="handelClickBackList"
>返回任务列表</el-button
>
<el-button
style="margin-left: 10px"
size="small"
class="diy-button--white"
plain
@click="handelClickBack"
>取消导入</el-button
>
</div>
</div>
<div class="right">
<h4>
<el-icon
class="el-icon-warning-outline"
style="color: #0056d6; font-size: 18px; font-weight: 600"
></el-icon>
操作说明
</h4>
<p>1导入数据多大系统需要一定事件处理</p>
<p>
2导入过程中可查看导入明细如果发现导入数据问题较多可以取消本次导入重新整理数据后重新创建任务导入
</p>
<p>3导入失败的数据您可以下载失败文件修改后重新创建任务导入</p>
</div>
</div>
<h3 class="title-small">数据导入明细</h3>
2 years ago
<el-row type="flex" justify="" >
<el-col :span="24">
{{this.importSuccessNum || '--'}}条数据已导入<el-button type="text" @click="handelClickLook('success')">查看</el-button>
</el-col>
</el-row>
<el-row type="flex" justify="" >
<el-col :span="24">
{{this.importFailNum || '--'}}条问题数据导入失败<el-button type="text" @click="handelClickLook('fail')">查看</el-button>
</el-col>
</el-row>
<!-- <el-dialog title="列表"
:visible.sync="dialogVisible"
width="50%">
<el-table :data="tableDate"
border
style="width: 100%">
<el-table-column type="设置类型">
</el-table-column>
<el-table-column prop="渲染绑定的表数据tableDate中的哪个数据"
label="显示名字"
width="180">
</el-table-column>
</el-table>
<span slot="footer"
class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary"
@click="dialogVisible = false"> </el-button>
</span>
</el-dialog> -->
</div>
</template>
<script>
2 years ago
import { requestPost,requestGet} from "@/js/dai/request";
export default {
data() {
return {
rules: {
importCategory: [
{ required: true, message: "请选择任务类型", trigger: "change" },
],
taskName: [
{ required: true, message: "请输入任务名称", trigger: "change" },
],
},
resident_category_import_list: [],
2 years ago
taskId:null,
timerId:null,
importSuccessNum:null,
importFailNum:null,
importCategory:null,
};
},
2 years ago
props: {
fileCode:{
type:String,
default:''
}
},
async created() {
await this.getTaskInfo();
// await this.getQuaryExcelDataList()
await this.startTimer();
},
methods: {
2 years ago
startTimer() {
if (!this.timerId ) {
this.timerId = setInterval(this.getProcessRate, 3000);
}
},
// 停止定时器
stopTimer() {
clearInterval(this.timerId);
this.timerId = null;
},
async getProcessRate() {
let url = '/actual/base/intelligentImportData/processRate'
let parm = {
fileCode:this.fileCode
}
let res= await requestPost(url, parm)
if(res.code == 0){
if(res.data == 100){
this.stopTimer()
}
}else if(code >= 8000){
this.$message.error(msg);
}
},
async getTaskInfo () {
let url = '/actual/base/intelligentImportData/getTaskInfo'
let parm = {
fileCode:this.fileCode
}
let {data,code,msg} = await requestPost(url, parm)
if(code == 0){
this.taskId = data.taskId;
this.importFailNum = data.importFailNum.toString();
this.importSuccessNum = data.importSuccessNum.toString();
this.importCategory = data.importCategory
if(data.processStatus != 'processing'){
this.stopTimer()
}
}else if(code >= 8000){
this.$message.error(msg);
}
// this.$emit("handelClickUpload");
},
async handelClickLook (type) {
let url = '/actual/base/excelDataShow/quaryExcelDataList'
let parm = {
taskId:this.taskId,
boolranFlag:type == 'success'?'1':'0',
pageNo:1,
pageSize:20,
importCategory:this.importCategory
}
let {data,code,msg} = await requestPost(url, parm)
if(code == 0){
console.log(data);
}else if(code >= 8000){
this.$message.error(msg);
}
// this.$emit("handelClickUpload");
},
async cancelTask(){
let url = '/actual/base/intelligentImportData/cancelTask'
let parm = {
fileCode:this.fileCode,
taskId:this.taskId
}
let {data,code,msg} = await requestPost(url, parm)
if(code == 0){
console.log(data);
this.$message.info('任务已取消');
this.$emit("handelClickBack");
}else if(code >= 8000){
this.$message.error(msg);
}
},
handelClickBack() {
this.$confirm(`您确定要取消本次数据导入任务吗`, {
confirmButtonText: '确定',
cancelButtonText: '再想想',
type: 'warning'
}).then(() => {
2 years ago
this.cancelTask()
}).catch(() => {
});
},
2 years ago
handelClickBackList(){
this.$emit("handelClickBack");
}
},
2 years ago
destroyed(){
this.stopTimer()
},
components: {},
computed: {},
watch: {},
};
</script>
<style lang="scss" scoped>
@import "@/assets/scss/buttonstyle.scss";
@import "@/assets/scss/modules/management/detail-main.scss";
@import "@/assets/scss/pages/smartImport.scss";
.left {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
color: #838383;
}
</style>