1.调整下载记录页面样式,添加详情弹窗

master
x_z 3 years ago
parent ff540b152a
commit 50502cb975

@ -6,7 +6,7 @@
<el-form :inline="true" :model="query" class="query-form" size="mini"> <el-form :inline="true" :model="query" class="query-form" size="mini">
<el-row> <el-row>
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
<el-input v-model="filterQuery.id" placeholder="记录ID"></el-input> <el-input v-model="filterQuery.taskId" placeholder="任务ID"></el-input>
</el-form-item> </el-form-item>
<el-form-item class="query-form-item"> <el-form-item class="query-form-item">
@ -17,15 +17,6 @@
<el-option label="异常" value="2"></el-option> <el-option label="异常" value="2"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item class="query-form-item">
<el-date-picker
v-model="syncTime"
type="datetime"
format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="请选择下载时间">
</el-date-picker>
</el-form-item>
<el-form-item> <el-form-item>
<el-button-group style="display:flex;"> <el-button-group style="display:flex;">
<el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button> <el-button type="primary" icon="el-icon-refresh" @click="onReset"></el-button>
@ -42,8 +33,8 @@
> >
<el-table-column label="序号" type="index"></el-table-column> <el-table-column label="序号" type="index"></el-table-column>
<el-table-column <el-table-column
label="记录ID" label="任务ID"
prop="id" prop="taskId"
width="140" width="140"
show-overflow-tooltip show-overflow-tooltip
></el-table-column> ></el-table-column>
@ -93,6 +84,13 @@
<el-table-column label="操作" fixed="right" width="160"> <el-table-column label="操作" fixed="right" width="160">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button
type="text"
size="small"
@click.native.stop="detailDialog(scope.row.id)"
>详情
</el-button
>
<el-button <el-button
type="text" type="text"
size="small" size="small"
@ -111,217 +109,232 @@
></el-pagination> ></el-pagination>
</el-card> </el-card>
<el-dialog
title="同步信息"
width="25%"
:close-on-click-modal="false"
:close-on-press-escape="false"
:visible.sync="syncVisible"
>
<span v-text="syncInfo" style="white-space:pre-line;" class="syncInfo"></span>
</el-dialog>
</div> </div>
</template> </template>
<script> <script>
import {filterLog, deleteLog, findConfig} from "../../api/thrsys/spsSyncDownload"; import {filterLog, deleteLog, findConfig} from "../../api/thrsys/spsSyncDownload";
import store from "@/store"; import store from "@/store";
export default {
data() {
return {
filterQuery: {
taskId: null,
status: "1",
page: 1,
limit: 10,
syncTime: null,
},
list: [],
headers: {},
detailList: [],
thirdSys: [],
thirdSysDetail: null,
total: 0,
currentRow: null,
editQuery: null,
type: {
"AutoDownloadOrder": "已完成单据",
"AutoDownloadBusType": "单据类型",
"AutoDownloadAllData": "基础信息",
"AutoDownloadDiProducts": "国家库DI数据"
},
status: {
0: "等待处理",
1: "处理完成",
2: "处理异常",
},
export default { configQuery: {
data() { id: null,
return { typeBus: null,
filterQuery: { typeScan: null,
id: null, typeThird: null,
status: "1", basicProducts: null,
page: 1, basicCorp: null,
limit: 10, basicInv: null,
basicThirdProducts: null,
basicThirdCorp: null,
basicThirdInv: null,
basicThirdBusOrder: null,
orderScanFinish: null,
dbDiProducts: null,
downstreamEnable: null,
syncTime: null,
},
uploadFileUrl: null,
uploadData: {
thirdSys: "thirdId",
},
templateDlUrl: null,
checked: false,
syncTime: null, syncTime: null,
syncInfo: null,
syncVisible: false
};
},
methods: {
onReset() {
this.$router.push({
path: "",
});
this.filterQuery = {
taskId: null,
status: "1",
page: 1,
limit: 20,
};
this.getList();
}, },
list: [], getList() {
headers: {}, this.loading = true;
detailList: [], filterLog(this.filterQuery)
thirdSys: [], .then((response) => {
thirdSysDetail: null, this.loading = false;
total: 0, if (response.code == 20000) {
currentRow: null, this.list = response.data.list || [];
editQuery: null, this.total = response.data.total || 0;
type: { } else {
"AutoDownloadOrder": "已完成单据", this.$message.error(response.message);
"AutoDownloadBusType": "单据类型", }
"AutoDownloadAllData": "基础信息", })
"AutoDownloadDiProducts": "国家库DI数据" .catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
}, },
status: {
0: "等待处理", getConfig() {
1: "处理完成", findConfig()
2: "处理异常", .then((response) => {
if (response.code == 20000) {
this.configQuery = response.data;
} else {
this.$message.error(response.message);
}
})
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
}, },
configQuery: { cancelDialog(val) {
id: null, this.udiImportDetailVisible = false;
typeBus: null, this.thrCorpSelectVisible = false;
typeScan: null, if (val) {
typeThird: null, this.getList();
basicProducts: null, }
basicCorp: null,
basicInv: null,
basicThirdProducts: null,
basicThirdCorp: null,
basicThirdInv: null,
basicThirdBusOrder: null,
orderScanFinish: null,
dbDiProducts: null,
downstreamEnable: null,
syncTime: null,
}, },
uploadFileUrl: null, handleCurrentChange(val) {
uploadData: { this.filterQuery.page = val;
thirdSys: "thirdId", this.getList();
}, },
templateDlUrl: null,
checked: false,
syncTime: null,
};
},
methods: { deleteDialog(rowId) {
onReset() { this.$confirm("此操作将删除该任务信息, 是否继续?", "提示", {
this.$router.push({ confirmButtonText: "确定",
path: "", cancelButtonText: "取消",
}); type: "warning",
this.filterQuery = {
id: null,
status: "1",
page: 1,
limit: 20,
};
this.getList();
},
getList() {
this.loading = true;
filterLog(this.filterQuery)
.then((response) => {
this.loading = false;
if (response.code == 20000) {
this.list = response.data.list || [];
this.total = response.data.total || 0;
} else {
this.$message.error(response.message);
}
}) })
.catch(() => { .then(() => {
this.loading = false; let dQuery = {
this.list = []; id: rowId,
this.total = 0; };
}); deleteLog(dQuery)
}, .then((response) => {
this.loading = false;
getConfig() { if (response.code == 20000) {
findConfig() this.$message.success("删除成功");
.then((response) => { } else {
if (response.code == 20000) { this.$message.error(response.message);
this.configQuery = response.data; }
} else { this.getList();
this.$message.error(response.message); })
.catch(() => {
this.loading = false;
});
})
.catch(() => {
});
},
handleChange(response, files, fileList) {
console.log(response);
if (response.code != 20000) {
this.$message.error(response.message);
this.getList();
} else {
// console.log(files[0] + "\n" + this.fileList[0] + "\n" + fileList[0]);
this.$message.success(response.data);
this.getList();
}
},
statusFilterType(status) {
const statusMap = {
0: "warning",
1: "success",
2: "danger",
};
return statusMap[status];
},
detailDialog(id) {
this.syncVisible = true;
this.list.forEach(item => {
if (id === item.id) {
this.syncInfo = item.remark;
} }
}) })
.catch(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
},
cancelDialog(val) {
this.udiImportDetailVisible = false;
this.thrCorpSelectVisible = false;
if (val) {
this.getList();
} }
} },
,
handleCurrentChange(val) {
this.filterQuery.page = val;
this.getList();
}
,
deleteDialog(rowId) { mounted() {
this.$confirm("此操作将删除该任务信息, 是否继续?", "提示", { },
confirmButtonText: "确定", components: {},
cancelButtonText: "取消", created() {
type: "warning", this.headers = {
}) ADMIN_ID: store.getters.adminId,
.then(() => { ADMIN_TOKEN: store.getters.token,
let dQuery = {
id: rowId,
};
deleteLog(dQuery)
.then((response) => {
this.loading = false;
if (response.code == 20000) {
this.$message.success("删除成功");
} else {
this.$message.error(response.message);
}
this.getList();
})
.catch(() => {
this.loading = false;
});
})
.catch(() => {
});
}
,
handleChange(response, files, fileList) {
console.log(response);
if (response.code != 20000) {
this.$message.error(response.message);
this.getList();
} else {
// console.log(files[0] + "\n" + this.fileList[0] + "\n" + fileList[0]);
this.$message.success(response.data);
this.getList();
}
}
,
statusFilterType(status) {
const statusMap = {
0: "warning",
1: "success",
2: "danger",
}; };
return statusMap[status]; this.getList();
} this.getConfig();
, },
}, };
mounted() {
},
components: {},
created() {
this.headers = {
ADMIN_ID: store.getters.adminId,
ADMIN_TOKEN: store.getters.token,
};
this.getList();
this.getConfig();
},
};
</script> </script>
<style> <style>
.itemTag { .itemTag {
float: left; float: left;
text-align: left; text-align: left;
margin-top: 10px; margin-top: 10px;
width: 100px; width: 100px;
} }
.text { .text {
font-size: 13px; font-size: 13px;
font-family: "Microsoft YaHei"; font-family: "Microsoft YaHei";
} }
.el-row { .el-row {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
} }
.el-col { .el-col {
border-radius: 4px; border-radius: 4px;
flex-wrap: wrap; flex-wrap: wrap;
} }
</style> </style>

Loading…
Cancel
Save