|
|
|
@ -38,18 +38,44 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<h3 class="title-small">数据导入明细</h3> |
|
|
|
<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> |
|
|
|
import { requestPost } from "@/js/dai/request"; |
|
|
|
import { requestPost,requestGet} from "@/js/dai/request"; |
|
|
|
|
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
form: { |
|
|
|
importCategory: null, |
|
|
|
taskName: null, |
|
|
|
}, |
|
|
|
rules: { |
|
|
|
importCategory: [ |
|
|
|
{ required: true, message: "请选择任务类型", trigger: "change" }, |
|
|
|
@ -59,15 +85,100 @@ export default { |
|
|
|
], |
|
|
|
}, |
|
|
|
resident_category_import_list: [], |
|
|
|
taskId:null, |
|
|
|
timerId:null, |
|
|
|
importSuccessNum:null, |
|
|
|
importFailNum:null, |
|
|
|
importCategory:null, |
|
|
|
}; |
|
|
|
}, |
|
|
|
props: {}, |
|
|
|
created() { |
|
|
|
props: { |
|
|
|
fileCode:{ |
|
|
|
type:String, |
|
|
|
default:'' |
|
|
|
} |
|
|
|
}, |
|
|
|
async created() { |
|
|
|
await this.getTaskInfo(); |
|
|
|
// await this.getQuaryExcelDataList() |
|
|
|
await this.startTimer(); |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
|
|
|
|
handelClickUpload() { |
|
|
|
this.$emit("handelClickUpload"); |
|
|
|
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(`您确定要取消本次数据导入任务吗`, { |
|
|
|
@ -75,15 +186,18 @@ export default { |
|
|
|
cancelButtonText: '再想想', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
this.$emit("handelClickBack"); |
|
|
|
this.cancelTask() |
|
|
|
}).catch(() => { |
|
|
|
|
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
handelClickBackList(){ |
|
|
|
this.$emit("handelClickBack"); |
|
|
|
} |
|
|
|
}, |
|
|
|
destroyed(){ |
|
|
|
this.stopTimer() |
|
|
|
}, |
|
|
|
components: {}, |
|
|
|
computed: {}, |
|
|
|
watch: {}, |
|
|
|
|