dialog_approval.vue
3.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<script lang="ts" setup name="DialogApproval">
import { TableColumnWidth } from '@/utils/enum';
import {
getCrossDetailList,
crossPlatformApprove
} from '@/api/modules/workFlowService';
const { proxy } = getCurrentInstance() as any;
const emits = defineEmits([
"dialogCancel"
]);
const props = defineProps({
visible: {
type: Boolean,
default: false
},
currentRowInfo: {
type: Object,
default: {
}
}
})
const dialogInfo = ref({
visible: false,
size: 700,
direction: "column",
header: {
title: "主平台审批节点",
},
footer: {
visible: false
}
});
watch(() => props.visible, () => {
dialogInfo.value.visible = props.visible;
if (props.visible) {
isReSubmit.value = false;
tableInfo.value.data = [];
tableInfo.value.actionInfo.show = props.currentRowInfo?.crossPlatformApproveState == 'E';
gettableList();
}
}, {
immediate: true
})
/** 获取版本信息数据 */
const gettableList = () => {
tableInfo.value.loading = true;
getCrossDetailList({
pageIndex: 1,
pageSize: -1,
bizGuid: props.currentRowInfo.guid
}).then((res: any) => {
tableInfo.value.loading = false;
if (res.code == proxy.$passCode) {
const data = res.data || [];
tableInfo.value.data = data?.map(d => {
d.approveState = d.approveState == null ? undefined : d.approveState;
return d;
});
tableInfo.value.actionInfo.show = tableInfo.value.data?.[0] && data?.[0]?.approveState == 'E';
} else {
proxy.$ElMessage.error(res.msg);
}
})
}
const isReSubmit = ref(false);
const tableInfo = ref({
id: 'approval-table',
loading: false,
minPanelHeight: "60px",
minHeight: "60px",
fields: [
{ label: "序号", type: "index", width: TableColumnWidth.INDEX, align: "center", fixed: "left" },
{
label: "节点", field: "processName", width: 90
},
{ label: "处理对象", field: "operator", width: TableColumnWidth.USERNAME },
{ label: "操作时间", field: "operatingTime", width: TableColumnWidth.DATETIME, },
{
label: "审批状态", field: "approveState", width: 120, type: 'tag', align: 'center'
},
{ label: "审批原因", field: "approveSuggest", width: TableColumnWidth.DESCRIPTION },
],
data: [],
showPage: false,
actionInfo: {
show: props.currentRowInfo?.crossPlatformApproveState == 'E',
label: "操作",
type: "btn",
width: 100,
btns: [{
label: '重新发起',
click: (scope) => {
tableInfo.value.loading = true;
crossPlatformApprove({ approveGuid: props.currentRowInfo.approveVO.approveGuid, guid: props.currentRowInfo.guid }).then((res: any) => {
tableInfo.value.loading = false;
if (res.code == proxy.$passCode) {
proxy.$ElMessage({
type: "success",
message: '重新发起成功',
});
gettableList();
isReSubmit.value = true;
} else {
proxy.$ElMessage({
type: "error",
message: res.msg,
});
}
})
}
}]
}
});
const handleDialogCancel = () => {
dialogInfo.value.visible = false;
emits("dialogCancel", isReSubmit.value);
}
</script>
<template>
<el-dialog v-model="dialogInfo.visible" :title="dialogInfo.header.title" width="700" :modal="true"
:close-on-click-modal="true" destroy-on-close align-center @close="handleDialogCancel">
<Table ref="tableRef" :tableInfo="tableInfo" class="approval-table" />
</el-dialog>
</template>
<style lang="scss" scoped>
.approval-table {
height: 180px !important;
}
:deep(.cusror-inherit) {
cursor: inherit;
}
</style>