集成任务日志明细从v2移植到v3

This commit is contained in:
hyt 2024-05-16 10:59:03 +08:00
parent a43534f7dd
commit 856e9cd1ac
3 changed files with 902 additions and 0 deletions

View File

@ -0,0 +1,267 @@
/**
* @desc 集成任务日志明细
* @date 2024-01-11
*/
// 表头
const tableColumnData = [
{
label: '任务名称',
prop: 'plugin_name',
tooltip: true,
width: 300
},
{
label: '源系统编码',
prop: 'root_app_bill',
tooltip: true,
width: 200
},
{
label: '最新推送状态',
prop: 'new_state',
tooltip: true,
width: 200
},
{
label: '最新传输结果',
prop: 'new_transmit_info',
tooltip: true,
width: 600
},
{
label: '最新推送时间',
prop: 'new_push_date',
tooltip: true,
width: 300
},
{
label: '业务⽇期',
prop: 'business_date',
tooltip: true,
width: 200
},
{
label: '下游系统单号',
prop: 'new_system_number',
tooltip: true,
width: 200
},
{
label: '处理⼈',
prop: 'processor_name',
tooltip: true,
width: 300
},
{
label: '处理备注',
prop: 'processing_remarks',
tooltip: true,
width: 300
},
{
label: '处理时间',
prop: 'processing_time',
tooltip: true,
width: 200
},
]
const tableVersionColumn = [
{
label: '版本号',
prop: 'versionNumber',
},
{
label: '版本说明',
prop: 'versionDescription',
},
]
// 基本信息内容
const formRow = [
{
elCol: [{
label: '产品编码',
prop: 'code',
tag: 'elInput',
},{
label: '产品名称',
prop: 'name',
tag: 'elInput',
}]
},
{
elCol: [{
label: '产品分类',
prop: 'classify',
tag: 'elSelect',
options:[],
optionValue:'column_value',
optionLabel:'column_content',
span: 24
}]
},
{
elCol: [{
label: '产品简述',
prop: 'description',
tag: 'elInput',
type: 'textarea',
span: 24,
}]
},
{
elCol: [{
label: '出品公司',
prop: 'productionCompany',
tag: 'elInput',
span: 24,
}]
},
]
const basicsRules ={
code:[{
required: true,
message: '请输入产品编码',
trigger: 'blur'
}],
name:[{
required: true,
message: '请输入产品名称',
trigger: 'blur'
}],
classify:[{
required: true,
message: '请选择产品分类',
trigger: 'blur'
}],
productionCompany:[{
required: true,
message: '请输入出品公司',
trigger: 'blur'
}],
}
// 查看
const formRowShow = [
{
elCol: [{
label: '源系统主键',
prop: 'root_app_pk',
tag: 'elInput',
disabled:true,
placeholder:"暂无数据"
},{
label: '源系统编码',
prop: 'root_app_bill',
tag: 'elInput',
disabled:true,
placeholder:"暂无数据"
}]
},
{
elCol: [{
label: '创建时间',
prop: 'create_time',
tag: 'elInput',
disabled:true,
placeholder:"暂无数据"
},{
label: '最新推送状态',
prop: 'new_state',
tag: 'elRadio',
options: [
{ label: '成功', value: 'Y' },
{ label: '已处理', value: 'H' },
{ label: '失败', value: 'N' },
],
disabled:true
}
]
},
{
elCol: [{
label: '最新传输结果',
prop: 'new_transmit_info',
tag: 'elInput',
type: 'textarea',
disabled:true,
span: 24,
placeholder:"暂无数据"
}]
},
{
elCol: [{
label: '最新元数据',
prop: 'root_app_new_data',
tag: 'elInput',
type: 'textarea',
disabled:true,
span: 24,
placeholder:"暂无数据"
}]
},
{
elCol: [{
label: '最新推送时间',
prop: 'new_push_date',
tag: 'elInput',
disabled:true,
placeholder:"暂无数据"
},{
label: '业务日期',
prop: 'business_date',
tag: 'elInput',
disabled:true,
placeholder:"暂无数据"
}]
},
{
elCol: [{
label: '下游系统主键',
prop: 'new_system_number',
tag: 'elInput',
disabled:true,
placeholder:"暂无数据"
},{
label: '下游系统单号',
prop: 'new_system_primary',
tag: 'elInput',
disabled:true,
placeholder:"暂无数据"
}]
},
{
elCol: [{
label: '处理人名称',
prop: 'processor_name',
tag: 'elInput',
disabled:true,
placeholder:"暂无数据"
},{
label: '处理时间',
prop: 'processing_time',
tag: 'elInput',
disabled:true,
placeholder:"暂无数据"
}]
},
{
elCol: [{
label: '处理备注 ',
prop: 'processing_remarks',
tag: 'elInput',
type: 'textarea',
span: 24,
disabled:true,
placeholder:"暂无数据"
}]
}
]
export default {
tableColumnData,
formRow,
basicsRules,
formRowShow,
tableVersionColumn
}

View File

@ -0,0 +1,371 @@
<template>
<div>
<base-layout ref="baseLayout" :buttonList="buttonList" @onFuncBtn="onFuncBtn" :querySwitch="true"
:searchBtnList="searchBtnList" :searchList="requirementList" @search="handleSearchEvent" :isPage="true"
@pageChange="handlePageChange" @onFuncSearchBtn="onFuncSearchBtn">
<div slot="main" slot-scope="{ tableHeight }">
<base-table ref="baseTable" :showIndex="true" :funWidth="350" :funData="funData" @onFunc="onFunc"
:tabLoading.sync="tabLoading" :tableHeight="tableHeight" :tableData="tableData"
:fixedTable="'right'" :tableColumn="tableColumnData" :showSelect="true">
<template v-slot:new_state="{ row }">
<div style="width: 100%">
<span v-if="row.new_state == 'Y'" style="color: #67c23a">成功</span>
<span v-else-if="row.new_state == 'H'" style="color: #67c23a">已处理</span>
<span v-else style="color: #f56c6c">失败</span>
</div>
</template>
</base-table>
</div>
</base-layout>
<right-dialog ref="rightDialog" @resetTable="resetTable"></right-dialog>
</div>
</template>
<script>
import baseLayout from "@/components/base/baseLayout";
import baseTable from "@/components/base/baseTable";
import rightDialog from "./rightDialog";
import configData from "./configData";
import {
authApi
} from "@/api/apis/auth";
import { option } from "@/api/apis/detailData"
export default
{
components: {
baseLayout,
baseTable,
rightDialog,
},
data() {
return {
buttonList: [
{
menuName: "刷新",
icon: "el-icon-refresh",
btnFunction: "resetLoad",
},
], //
searchBtnList: [
{
name: "批量推送",
btnFunction: "batchPush",
},
], //
requirementList: [
{
placeholder: "任务名称",
prop: "plugin_id",
tag: "elSelect",
options: [],
optionValue: "pluginId",
optionLabel: "pluginName",
},
{
placeholder: "源系统编码",
prop: "root_app_bill",
tag: "elInput",
},
{
placeholder: "推送时间",
prop: "new_push_date",
tag: "elDatePicker",
valueFormat: "yyyy-MM-dd",
},
{
placeholder: "业务⽇期",
prop: "business_date",
tag: "elDatePicker",
valueFormat: "yyyy-MM-dd",
},
{
placeholder: "下游系统单号",
prop: "new_system_number",
tag: "elInput",
},
{
placeholder: "推送状态",
prop: "new_state",
tag: "elRadio",
options: [
{ label: "全部", value: "" },
{ label: "成功", value: "Y" },
{ label: "已处理", value: "H" },
{ label: "失败", value: "N" },
],
},
], //list
tabLoading: false,
tableColumnData: configData.tableColumnData, //
funData: [
{
color: "#6a9af1",
text: "查看",
},
{
color: "#6a9af1",
text: "重新推送",
},
{
color: "#6a9af1",
text: "手工处理",
},
{
color: "#d67a74",
text: "删除",
},
],
tableData: [], //
pageModel: {
pageNum: 1,
pageSize: 10,
},
queryModel: {
plugin_id: '',
root_app_bill: '',
new_push_date: '',
business_date: '',
new_system_number: '',
new_state: 'N'
},
};
},
mounted() {
this.$refs.baseLayout.getField("new_state", "N");
this.queryProductClassfy();
this.GetProductionTableData();
},
methods: {
//
async GetProductionTableData() {
this.tabLoading = true;
const res = await option({
tl: "integration_task_living_detailsService",
as: "integrationTaskLog",
dj: "queryPage",
}, {
...this.pageModel,
...this.queryModel
})
this.tabLoading = false;
if (res.status == "200") {
this.tableData = res.attribute.list;
this.$refs.baseTable.setTableKey()
this.$refs.baseLayout.setPageTotal(res.attribute.total);
}
},
async queryProductClassfy() {
const res = await option({
tl: "pluginService",
as: "plugins",
dj: "queryPlugins",
}, {})
if (res.status == "200") {
this.requirementList[0].options = res.attribute;
}
},
//
handleSearchEvent() {
let data = this.$refs.baseLayout.ruleForm;
this.queryModel.plugin_id = data.plugin_id;
this.queryModel.root_app_bill = data.root_app_bill;
this.queryModel.new_push_date = data.new_push_date;
this.queryModel.business_date = data.business_date;
this.queryModel.new_system_number = data.new_system_number;
this.queryModel.new_state = data.new_state;
this.resetTable();
},
//
async batchPush() {
let data = ''
this.$refs.baseTable.$refs.elTable.selection.forEach(el => {
if (data == '') {
data = el.id
} else {
data += `,${el.id}`
}
});
if (data.length > 0) {
this.$confirm("确认重新推送吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.openLoading("submit");
this.rePushBatch(data)
})
.catch(() => {
this.$vmNews("取消操作", "info");
});
} else {
this.$vmNews("请选择需要推送的单据", "warning");
}
},
async rePushBatch(data) {
const res = await option({
tl: "integration_task_living_detailsService",
as: "integrationTaskLog",
dj: "batchPush",
}, {
id: data
})
if (res.status == "200") {
this.$vmNews("批量推送成功", "success");
this.resetTable();
}
},
//
handlePageChange(val) {
this.pageModel.pageNum = val.pageIndex;
this.pageModel.pageSize = val.pageSize;
this.GetProductionTableData();
},
//
onFuncBtn(btn) {
this[btn.btnFunction]();
},
//
onFuncSearchBtn(btn) {
this[btn.btnFunction]();
},
//
add() {
this.$refs.rightDialog.openDialog("add");
},
//
async onFunc(index, row) {
//
if (index == 0) {
this.openLoading("detail");
this.$refs.rightDialog.openDialog("show", row);
}
//
if (index == 1) {
this.$confirm("确认重新推送吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.openLoading("submit");
this.handleRePush(row);
})
.catch(() => {
this.$vmNews("取消操作", "info");
});
}
//
if (index == 2) {
this.$prompt("请填写旺店通或者NC的单据号方便以后排查", "提示", {
confirmButtonText: "提交",
cancelButtonText: "取消",
inputType: "textarea",
inputValidator: (value) => {
if (!value) {
return "请输入处理内容";
}
},
})
.then(({ value }) => {
this.openLoading("submit");
let params =
{
id: row.id,
processing_remarks: value,
}
;
this.updateManualProcess(params);
})
.catch(() => {
this.$message({
type: "info",
message: "取消操作",
});
});
}
//
if (index == 3) {
this.$confirm("确认删除该内容吗?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.openLoading("del");
this.productionDeleteById(row.id);
})
.catch(() => {
this.$vmNews("取消操作", "info");
});
}
},
async handleRePush(row) {
const res = await option({
tl: "integration_task_living_detailsService",
as: "integrationTaskLog",
dj: "repush",
}, {
id: row.id
})
if (res.status == "200") {
this.$vmNews("补推成功", "success");
this.resetTable();
} else if (res.status == "500") {
this.$message({
title: "补推失败",
showClose: true,
message: res.msg,
duration: 0,
type: "error",
});
this.resetTable();
}
},
async updateManualProcess(val) {
const res = await option({
tl: "integration_task_living_detailsService",
as: "integrationTaskLog",
dj: "manualProcessing",
}, val)
if (res.status == "200") {
this.$vmNews("手工处理成功", "success");
this.resetTable();
}
},
async productionDeleteById(id) {
const res = await option({
tl: "integration_task_living_detailsService",
as: "integrationTaskLog",
dj: "deleteEntity",
}, {
id
})
if (res.status == "200") {
this.$vmNews("删除成功", "success");
this.resetTable();
}
},
//
resetTable() {
this.pageModel.pageNum = 1;
this.$refs.baseLayout.pageClear();
this.GetProductionTableData();
},
},
};
</script>
<style scoped>
.clickTitle {
color: #409eff;
cursor: pointer;
}
::v-deep .searchBox:nth-child(6) {
width: 250px !important;
}
</style>

View File

@ -0,0 +1,264 @@
<template>
<div>
<base-right-dialog ref="baseRightDialog" :footerShow="true" :dialogVisible.sync="dialogVisible"
:title="dialogTitle + ' 集成产品清单'" @handleClose="handleDialogClose" :type="dialogType" :submitShow="submitShow"
@handleConfirmClick="handleConfirmClick">
<base-form ref="basicsForm" :formRow="formRow" :isFunBtn="false" :rules="basicsRules" class="dialog_form"
:spanWidth="`120px`" :loading="vLoading"></base-form>
</base-right-dialog>
</div>
</template>
<script>
import baseRightDialog from "@/components/base/baseRightDialog";
import baseForm from "@/components/base/baseNewForm";
import baseTable from "@/components/base/baseTable";
import configData from "./configData";
import { authApi } from "@/api/apis/auth";
import { option } from "@/api/apis/detailData"
export default {
components: {
baseRightDialog,
baseForm,
baseTable,
},
data() {
return {
dialogVisible: false,
dialogTitle: "",
dialogType: "",
formRow: configData.formRow,
basicsRules: configData.basicsRules,
vLoading: false,
newMarryOptions: [],
submitShow: true,
loadingType: true,
tableVersionData: [],
tableVersionColumn: configData.tableVersionColumn,
funData: [],
isEdit: false
};
},
mounted() { },
methods: {
openDialog(type, row) {
// this.queryProductClassfy();
this.formRow = configData.formRow;
this.submitShow = true;
this.isEdit = false
this.funData = [
{
color: "#ff0000",
text: "删除",
}
]
//
if (type == "add") {
this.dialogTitle = "新增";
this.dialogType = "add";
}
//
if (type == "edit") {
this.isEdit = true
this.dialogTitle = "编辑";
this.dialogType = "edit";
this.productGetById(row.id);
}
//
if (type == "show") {
this.funData = Object.assign([], [])
this.submitShow = false;
this.formRow = configData.formRowShow;
this.dialogTitle = "查看";
this.dialogType = "show";
this.productGetById(row.id);
}
this.dialogVisible = true;
},
async productGetById(id) {
this.openLoading("detail");
const res = await option({
tl: "integration_task_living_detailsService",
as: "integrationTaskLog",
dj: "queryEntity",
}, {
id
})
if (res.status == '200') {
this.$refs.basicsForm.incomingParameters(res.attribute);
}
},
//
// async productGetById(id) {
// let params = {
// id: id,
// };
// let res = await authApi(
// "sysProductService",
// "product",
// "queryProduct",
// "",
// params
// );
// if (res.status == "200") {
// this.$nextTick(() => {
// this.$refs.basicsForm.incomingParameters(res.attribute);
// let result = [];
// if (res.attribute.sysProductVersionList.length > 0) {
// res.attribute.sysProductVersionList.forEach((item) => {
// let obj = {
// id: item.id,
// versionNumber: item.versionNumber,
// versionDescription: item.versionDescription,
// disabled: true
// };
// result.push(obj);
// });
// }
// this.tableVersionData = Object.assign([], result);
// });
// }
// },
addVersionDialog() {
let obj = {
id: new Date().getTime().toString(),
versionNumber: "",
versionDescription: "",
disabled: false
};
this.tableVersionData.push(obj);
},
//
onFunc(index, row) {
if (index == 0) {
this.$delConfirm().then(() => {
this.tableVersionData.forEach((item, itemIndex) => {
if (item.id === row.id) {
this.tableVersionData.splice(itemIndex, 1);
}
});
});
}
},
//
handleDialogClose() {
this.tableVersionData = Object.assign([], []);
this.$refs.basicsForm.resetFields();
this.dialogVisible = false;
},
//
handleConfirmClick() {
this.$refs.basicsForm.$refs["ruleForm"].validate((valid) => {
if (!valid) {
return;
} else {
let params = {
...this.$refs.basicsForm.ruleForm,
sysProductVersionList: [],
};
let result = [];
if (this.tableVersionData.length > 0) {
this.tableVersionData.forEach((item) => {
let obj = {
versionNumber: item.versionNumber,
versionDescription: item.versionDescription,
};
result.push(obj);
});
}
params.sysProductVersionList = Object.assign([], result);
if (this.dialogType == "add") {
this.openLoading("submit");
this.productSaveDto(params);
}
if (this.dialogType == "edit") {
this.openLoading("submit");
this.productUpdateDto(params);
}
}
});
},
//
async productSaveDto(params) {
let res = await authApi(
"sysProductService",
"product",
"addProduct",
"",
params
);
if (res.status == "200") {
this.handleDialogClose();
this.$vmNews("新增成功", "success");
this.$emit("resetTable");
}
},
//
async productUpdateDto(params) {
let res = await authApi(
"sysProductService",
"product",
"updateProduct",
"",
params
);
if (res.status == "200") {
this.handleDialogClose();
this.$vmNews("更新成功", "success");
this.$emit("resetTable");
}
},
//
async queryProductClassfy() {
let params = {
tab_name: "sys_product",
column_name: "classify",
};
let res = await authApi(
"generalServiceImpl",
"dictionaryshop",
"selectDictionaryshop",
"",
params
);
if (res.status == "200") {
this.formRow[1].elCol[0].options = res.attribute;
}
},
},
};
</script>
<style scoped lang="scss">
.dialogList {
padding: 16px 0;
border-top: 1px solid #dcdfe6;
display: flex;
flex-direction: column;
}
.updateBtn {
border: 1px solid #ebedf1;
padding: 5px 0;
border-radius: 3px;
text-align: center;
font-size: 14px;
cursor: pointer;
width: 100px;
}
.updateBtn:hover {
color: #1890ff;
border-color: #badeff;
background-color: #e8f4ff;
}
::v-deep .el-table__body-wrapper.is-scrolling-none {
height: auto !important;
}
::v-deep .app-container {
height: auto !important;
}
</style>