sanmu
authored
|
33
34
35
36
37
38
39
40
41
|
import { approveAuditApi, getWaitListApi, getApprovedListApi } from '/@/api/project/approve';
export default defineComponent({
components: {
PageWrapper,
BasicTable,
TableAction,
[Tabs.name]: Tabs,
[Tabs.TabPane.name]: Tabs.TabPane,
|
sanmu
authored
|
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
|
},
setup() {
const checkedKeys = ref<Array<string | number>>([]);
const currentKey = ref('1');
const [registerTable1, { reload }] = useTable({
api: getWaitListApi,
columns: [
{
title: '申请人',
dataIndex: 'createBy',
width: 150,
},
{
title: '申请字段',
dataIndex: 'fields',
width: 600,
},
{
title: '订单号',
dataIndex: 'no6',
},
{
title: '订单字段1',
dataIndex: 'no5',
},
{
title: '订单字段2',
dataIndex: 'no4',
},
{
title: '订单字段3',
dataIndex: 'no3',
},
{
title: '订单字段5',
dataIndex: 'no1',
},
],
// useSearchForm: true,
// formConfig: getFormConfig(),
rowKey: 'id',
actionColumn: {
width: 160,
title: 'Action',
dataIndex: 'action',
// slots: { customRender: 'action' },
},
});
const [registerTable2] = useTable({
api: getApprovedListApi,
columns: [
{
title: '申请人',
dataIndex: 'createBy',
width: 150,
},
|
sanmu
authored
|
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
|
],
rowKey: 'id',
});
// function getFormValues() {
// console.log(getForm1().getFieldsValue());
// }
function onSelect(record, selected) {
if (selected) {
checkedKeys.value = [...checkedKeys.value, record.id];
} else {
checkedKeys.value = checkedKeys.value.filter((id) => id !== record.id);
}
}
function onSelectAll(selected, selectedRows, changeRows) {
const changeIds = changeRows.map((item) => item.id);
if (selected) {
checkedKeys.value = [...checkedKeys.value, ...changeIds];
} else {
checkedKeys.value = checkedKeys.value.filter((id) => {
return !changeIds.includes(id);
});
}
}
function handleEdit(record, e) {
e?.stopPropagation();
return false;
}
async function handleTrue(record) {
await approveAuditApi({ status: 10, id: record.id });
reload();
}
async function handleFalse(record) {
await approveAuditApi({ status: 20, id: record.id });
reload();
}
return {
registerTable1,
registerTable2,
checkedKeys,
currentKey,
onSelect,
handleEdit,
onSelectAll,
handleTrue,
handleFalse,
};
},
});
</script>
|