Browse Source

数据看板架构背景颜色修改,智能导入下载失败文件接口调整

feature
mk 1 year ago
parent
commit
fb664911ff
  1. 2
      src/components/GridTree/nodeWrap.vue
  2. 52
      src/views/modules/base/smartImport/cpts/completeTask.vue

2
src/components/GridTree/nodeWrap.vue

@ -35,7 +35,7 @@
</div>
</div>
<div v-if="item.level === 'unit_chief'">
<div @click="gotoPersonnel(item)" :class="[ item.id === '1704434839867420673'?'dyzxhYellow':'dyzxhGreen']" :title="item.organizationName">
<div @click="gotoPersonnel(item)" :class="[item.categoryWarn === 'red' ? 'dyzxhRed' : item.categoryWarn === 'yellow' ? 'dyzxhYellow' : item.categoryWarn === 'green' ? 'dyzxhGreen' : '', item.children && item.children.length > 0 ? 'dyzxhHover' : 'dyzxh']" :title="item.organizationName">
<!-- {{ spliceNameFun(item.organizationName, 3) }} -->
{{ item.organizationName }}
</div>

52
src/views/modules/base/smartImport/cpts/completeTask.vue

@ -42,12 +42,11 @@
>查看</el-button
>
<i class="el-icon-download" style="margin-left: 16px;"></i>
<a
v-if="resultDescFile"
:href="resultDescFile"
target="_blank"
style="color: #ff4d4f; cursor: pointer"
>下载导入失败数据</a
<el-button
v-if="this.importFailNum>0"
type="text"
@click="handelClickDownFile"
>下载导入失败数据</el-button
>
</el-col>
</el-row>
@ -92,6 +91,7 @@
</template>
<script>
import { requestPost } from "@/js/dai/request";
import axios from "axios";
export default {
data() {
return {
@ -105,7 +105,9 @@ export default {
pageNo:1,
pageSize:20,
total:0,
tableType:null
tableType:null,
resultDescFilePath:null,
originFileName:null,
};
},
props: {
@ -169,6 +171,39 @@ export default {
},
handelClickBackList() {
this.$emit("handelClickBack");
},
handelClickDownFile(){
const url = "/actual/base/intelligentImportData/downloadFailExcel";
let parm = {
originFileName:this.originFileName,
resultDescFilePath :this.resultDescFilePath,
};
axios({
url: window.SITE_CONFIG["apiURL"] + url,
method: "post",
data:parm,
responseType: "blob",
})
.then((res) => {
let fileName = window.decodeURI(
res.headers["content-disposition"].split(";")[1].split("=")[1]
);
console.log("filename", fileName);
let blob = new Blob([res.data], { type: "application/vnd.ms-excel" });
var url = window.URL.createObjectURL(blob);
var aLink = document.createElement("a");
aLink.style.display = "none";
aLink.href = url;
aLink.setAttribute("download", fileName);
document.body.appendChild(aLink);
aLink.click();
document.body.removeChild(aLink); //
window.URL.revokeObjectURL(url); //blob
})
.catch((err) => {
console.log("获取导出情失败", err);
return this.$message.error("网络错误");
});
},
async getTaskInfo() {
let url = "/actual/base/intelligentImportData/getTaskInfo";
@ -181,7 +216,8 @@ export default {
this.importFailNum = data.importFailNum.toString();
this.importSuccessNum = data.importSuccessNum.toString();
this.importCategory = data.importCategory;
this.resultDescFile = data.resultDescFile;
this.originFileName = data.originFileName;
this.resultDescFilePath = data.resultDescFile;
this.$emit("updateoperatorName", {
operatorName: data.operatorName,
createdTime: data.createdTime,

Loading…
Cancel
Save