界面,bug修改

master
anthonywj 2 years ago
parent e25955f87b
commit 53aa02c14b

@ -37,10 +37,7 @@
<el-table-column label="序号" type="index"></el-table-column> <el-table-column label="序号" type="index"></el-table-column>
<el-table-column label="任务ID" prop="taskId" width="180" show-overflow-tooltip></el-table-column> <el-table-column label="任务ID" prop="taskId" width="180" show-overflow-tooltip></el-table-column>
<el-table-column label="任务类型" prop="idDatas" width="140" show-overflow-tooltip> <el-table-column label="任务类型" prop="type" width="140" show-overflow-tooltip>
<template slot-scope="scope">
<span>{{ type[scope.row.idDatas] }}</span>
</template>
</el-table-column> </el-table-column>
<!-- <el-table-column <!-- <el-table-column
label="状态" label="状态"
@ -67,27 +64,32 @@
<el-table-column label="同步信息" prop="remark" show-overflow-tooltip></el-table-column> <el-table-column label="同步信息" prop="remark" show-overflow-tooltip></el-table-column>
<el-table-column label="文件路径" prop="cacheFilePath" show-overflow-tooltip></el-table-column> <el-table-column label="文件路径" prop="cacheFilePath" show-overflow-tooltip></el-table-column>
<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-popconfirm @confirm="downFile(scope.row)" confirm-button-text='' cancel-button-text='' <el-button
class="mr10" icon="el-icon-info" icon-color="blck" title="是否确认要下载文件?" type="text"
v-if="scope.row.cacheFilePath"> size="small"
<el-button type="text" size="small" slot="reference">下载 @click.native.stop="downFile(scope.row)"
</el-button> >下载
</el-popconfirm> </el-button
<el-popconfirm @confirm="deleteData(scope.row.id)" confirm-button-text='' >
cancel-button-text='不用了' icon="el-icon-info" icon-color="red" title="是否确认要删除这条数据?"> <el-button
<el-button type="text" size="small" slot="reference">删除 type="text"
</el-button> size="small"
</el-popconfirm> @click.native.stop="deleteData(scope.row.id)"
>删除
</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination :current-page="filterQuery.page" :page-size="filterQuery.limit" @current-change="handleCurrentChange" <el-pagination :current-page="filterQuery.page" :page-size="filterQuery.limit"
layout="prev, pager, next" :total="total"></el-pagination> @current-change="handleCurrentChange"
layout="prev, pager, next" :total="total"></el-pagination>
</el-card> </el-card>
<el-dialog title="同步信息" width="25%" :close-on-click-modal="false" :close-on-press-escape="false" <el-dialog title="同步信息" width="25%" :close-on-click-modal="false" :close-on-press-escape="false"
:visible.sync="syncVisible"> :visible.sync="syncVisible">
<span v-text="syncInfo" style="white-space:pre-line;" class="syncInfo"></span> <span v-text="syncInfo" style="white-space:pre-line;" class="syncInfo"></span>
</el-dialog> </el-dialog>
@ -95,325 +97,328 @@
</template> </template>
<script> <script>
import { import {
filterUploadStatus, filterUploadStatus,
deleteUploadStatus, deleteUploadStatus,
updateConfig, updateConfig,
connectUpper, connectUpper,
uploadInfoByStatus uploadInfoByStatus, infoByStatus
} from "../../api/sync/dataSyncStatus"; } from "../../api/sync/dataSyncStatus";
import store from "@/store"; import store from "@/store";
export default { export default {
data() { data() {
return { return {
filterQuery: { filterQuery: {
taskId: null, taskId: null,
id: null, id: null,
// status: "0", // status: "0",
page: 1, page: 1,
limit: 10, 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: "处理异常",
},
configQuery: {
id: null,
typeBus: null,
typeScan: null,
typeThird: null,
basicProducts: null,
basicCorp: null,
basicInv: null,
basicThirdProducts: null,
basicThirdCorp: null,
basicThirdInv: null,
basicThirdBusOrder: null,
orderScanFinish: null,
dbDiProducts: null,
downstreamEnable: 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 = {
id: null,
page: 1,
limit: 10,
};
this.syncTime = null;
this.getList();
}, },
getList() { list: [],
this.loading = true; headers: {},
filterUploadStatus(this.filterQuery) detailList: [],
.then((response) => { thirdSys: [],
this.loading = false; thirdSysDetail: null,
if (response.code == 20000) { total: 0,
this.list = response.data.list || []; currentRow: null,
this.total = response.data.total || 0; editQuery: null,
} else { type: {
this.$message.error(response.message); "AutoDownloadOrder": "扫码单据",
} "AutoDownloadBusType": "单据类型",
}) "AutoDownloadAllData": "基础信息",
.catch(() => { "AutoDownloadDiProducts": "国家库DI数据"
this.loading = false; },
this.list = []; status: {
this.total = 0; 0: "等待处理",
}); 1: "处理完成",
2: "处理异常",
}, },
testConnect() { configQuery: {
id: null,
let query = {}; typeBus: null,
connectUpper(query) typeScan: null,
.then((response) => { typeThird: null,
this.loading = false; basicProducts: null,
if (response.code == 20000) { basicCorp: null,
this.$message.success("连接成功!"); basicInv: null,
} else { basicThirdProducts: null,
this.$message.error(response.message); basicThirdCorp: null,
} basicThirdInv: null,
}) basicThirdBusOrder: null,
.catch(() => { orderScanFinish: null,
this.loading = false; dbDiProducts: null,
}); downstreamEnable: null,
}, },
uploadFileUrl: null,
uploadData: {
thirdSys: "thirdId",
},
templateDlUrl: null,
checked: false,
syncTime: null,
syncInfo: null,
syncVisible: false
};
},
methods: {
onReset() {
this.$router.push({
path: "",
});
this.filterQuery = {
id: null,
page: 1,
limit: 10,
};
this.syncTime = null;
this.getList();
},
getList() {
this.loading = true;
filterUploadStatus(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(() => {
this.loading = false;
this.list = [];
this.total = 0;
});
},
testConnect() {
saveConfig() { let query = {};
updateConfig(this.configQuery) connectUpper(query)
.then((response) => { .then((response) => {
this.loading = false; this.loading = false;
if (response.code == 20000) { if (response.code == 20000) {
this.$message.success("更新成功!"); this.$message.success("连接成功!");
// this.getConfig(); } else {
} this.$message.error(response.message);
}) }
.catch(() => { })
this.loading = false; .catch(() => {
}); this.loading = false;
}, });
},
cancelDialog(val) {
this.udiImportDetailVisible = false; saveConfig() {
this.thrCorpSelectVisible = false; updateConfig(this.configQuery)
if (val) { .then((response) => {
this.getList(); this.loading = false;
} if (response.code == 20000) {
}, this.$message.success("更新成功!");
handleCurrentChange(val) { // this.getConfig();
this.filterQuery.page = val; }
})
.catch(() => {
this.loading = false;
});
},
cancelDialog(val) {
this.udiImportDetailVisible = false;
this.thrCorpSelectVisible = false;
if (val) {
this.getList(); this.getList();
}, }
},
handleCurrentChange(val) {
this.filterQuery.page = val;
this.getList();
},
/* createScheduleDialog(type) { /* createScheduleDialog(type) {
if (this.$isNotBlank(this.syncTime)) { if (this.$isNotBlank(this.syncTime)) {
this.$confirm("此操作将从" + this.syncTime + "开始同步最新数据,是否继续", "提示", { this.$confirm("此操作将从" + this.syncTime + "开始同步最新数据,是否继续", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
type: "warning", type: "warning",
}) })
.then(() => { .then(() => {
this.createSchedule(type); this.createSchedule(type);
})
.catch(() => {
});
} else {
this.createSchedule(type);
}
},
createSchedule(type) {
let query = {
createType: type,
syncTime: this.syncTime,
}
createSchedule(query)
.then((response) => {
this.loading = false;
if (response.code == 20000) {
this.$message.success("创建成功!");
} else if (response.code == 501) {
this.$alert(response.message, '提示', {
confirmButtonText: '确定',
type: "warning",
callback: action => {
}
});
} else {
this.$message.error(response.message);
}
this.getList();
}) })
.catch(() => { .catch(() => {
this.loading = false;
}); });
},*/ } else {
deleteDialog(rowId) { this.createSchedule(type);
this.$confirm("此操作将删除该任务信息, 是否继续?", "提示", { }
confirmButtonText: "确定",
cancelButtonText: "取消", },
type: "warning",
}) createSchedule(type) {
.then(() => { let query = {
let dQuery = { createType: type,
id: rowId, syncTime: this.syncTime,
}; }
deleteUploadStatus(dQuery)
.then((response) => { createSchedule(query)
this.loading = false; .then((response) => {
if (response.code == 20000) { this.loading = false;
this.$message.success("删除成功"); if (response.code == 20000) {
} else { this.$message.success("创建成功!");
this.$message.error(response.message); } else if (response.code == 501) {
}
this.getList(); this.$alert(response.message, '提示', {
}) confirmButtonText: '确定',
.catch(() => { type: "warning",
this.loading = false; callback: action => {
}); }
}) });
.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;
}
})
},
downFile(rows) { } else {
infoByStatus({ this.$message.error(response.message);
'id': rows.id }
}).then(res => { this.getList();
let blob = new Blob([res]) })
let fileName = rows.cacheFilePath.substring(rows.cacheFilePath.lastIndexOf('/')) .catch(() => {
let link = document.createElement("a") this.loading = false;
link.href = window.URL.createObjectURL(blob) });
link.download = fileName },*/
link.style.display = 'none' deleteDialog(rowId) {
document.body.appendChild(link) this.$confirm("此操作将删除该任务信息, 是否继续?", "提示", {
link.click() confirmButtonText: "确定",
window.URL.revokeObjectURL(link.href) cancelButtonText: "取消",
document.body.removeChild(link) type: "warning",
})
.then(() => {
let dQuery = {
id: rowId,
};
deleteUploadStatus(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(() => {
deleteData(id) { });
deleteUploadStatus({ },
id handleChange(response, files, fileList) {
}).then((response) => { console.log(response);
if (response.code == 20000) { if (response.code != 20000) {
this.filterQuery.page = 1 this.$message.error(response.message);
this.$message.success("删除成功"); this.getList();
} else { } else {
this.$message.error(response.message); // console.log(files[0] + "\n" + this.fileList[0] + "\n" + fileList[0]);
} this.$message.success(response.data);
this.getList(); this.getList();
})
.catch(() => {});
} }
}, },
statusFilterType(status) {
mounted() {}, const statusMap = {
components: {}, 0: "warning",
created() { 1: "success",
this.headers = { 2: "danger",
ADMIN_ID: store.getters.adminId,
ADMIN_TOKEN: store.getters.token,
}; };
this.getList(); return statusMap[status];
// this.getConfig(); },
detailDialog(id) {
this.syncVisible = true;
this.list.forEach(item => {
if (id === item.id) {
this.syncInfo = item.remark;
}
})
},
downFile(rows) {
infoByStatus({
'id': rows.id
}).then(res => {
let blob = new Blob([res])
let fileName = rows.cacheFilePath.substring(rows.cacheFilePath.lastIndexOf('/'))
let link = document.createElement("a")
link.href = window.URL.createObjectURL(blob)
link.download = fileName
link.style.display = 'none'
document.body.appendChild(link)
link.click()
window.URL.revokeObjectURL(link.href)
document.body.removeChild(link)
})
}, },
}; deleteData(id) {
deleteUploadStatus({
id
}).then((response) => {
if (response.code == 20000) {
this.filterQuery.page = 1
this.$message.success("删除成功");
} else {
this.$message.error(response.message);
}
this.getList();
})
.catch(() => {
});
}
},
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;
} }
.syncInfo { .syncInfo {
font-size: medium; font-size: medium;
font-family: "Microsoft YaHei"; font-family: "Microsoft YaHei";
line-height: 25px; line-height: 25px;
} }
</style> </style>

Loading…
Cancel
Save