You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

159 lines
4.2 KiB

12 months ago
<template>
<div>
<card-container>
<vxe-toolbar print custom export>
<template #buttons>
12 months ago
<el-date-picker
:value="(select.start_date && select.end_date) ? [select.start_date,select.end_date] : []"
type="daterange"
size="small"
value-format="yyyy-MM-dd"
clearable
style="width: 260px;"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
<el-button icon="el-icon-search" type="primary" plain size="small" style="margin-left: 6px;" @click="getList"></el-button>
12 months ago
</template>
</vxe-toolbar>
<vxe-table
ref="table"
stripe
style="margin-top: 10px;"
:loading="loading"
keep-source
show-overflow
:max-height="800"
:export-config="{}"
:print-config="{}"
:column-config="{resizable: true}"
:scroll-y="{enabled: true, gt: 100}"
:data="tableData"
>
<vxe-column type="seq" width="58" align="center" />
<vxe-column
min-width="180"
header-align="center"
field="title"
title="工作名称"
></vxe-column>
<vxe-column
align="center"
width="140"
field="current_node.name"
title="当前节点"
></vxe-column>
<vxe-column
width="200"
align="center"
field="created_at"
title="发起日期"
:formatter="
({ cellValue }) =>
$moment(cellValue).format('YYYY-MM-DD HH:mm:ss')
"
:export-method="
({ row, column, options }) =>
$moment(row['created_at']).format('YYYY-MM-DD HH:mm:ss')
"
></vxe-column>
<vxe-column
width="80"
align="center"
field="status"
title="当前状态"
:formatter="({ cellValue }) => myStatus.get(cellValue)"
:export-method="
({ row, column, options }) => myStatus.get(row['status'])
"
>
<template #default="{ row }">
<el-tag
size="mini"
:type="statusColor.get(row.status)"
effect="dark"
>{{ myStatus.get(row.status) }}</el-tag
>
</template>
</vxe-column>
<vxe-column
min-width="80"
align="center"
field="operate"
title="操作"
fixed="right"
>
<template #default="{ row }">
<el-button plain type="success" size="mini" @click="detail(row)"
>查看</el-button>
</template>
</vxe-column>
</vxe-table>
</card-container>
</div>
</template>
<script>
12 months ago
import { getOvertimeHoliday } from "@/api/flow"
12 months ago
export default {
data() {
return {
myStatus: new Map([
[-1, "已退回"],
[0, "办理中"],
[1, "已完成"],
]),
statusColor: new Map([
[-1, "warning"],
[0, ""],
[1, "success"],
]),
loading: false,
tableData: [],
select: {
page: 1,
page_size: 9999,
12 months ago
start_date: this.$moment().subtract(1, 'months').format('YYYY-MM-DD'),
end_date: this.$moment().add(1, 'months').format('YYYY-MM-DD')
12 months ago
},
12 months ago
total: 0,
12 months ago
}
},
methods: {
detail(row) {
this.$router.push(
12 months ago
`/flow/detail?module_id=${row.custom_model_id}&flow_id=${row.id}`
12 months ago
);
},
async getList() {
this.loading = true;
try {
12 months ago
const res = await getOvertimeHoliday(this.select, false);
12 months ago
console.log(res);
12 months ago
this.tableData = res?.flows?.data || [];
this.total = res?.flows?.total ?? 0;
12 months ago
this.loading = false;
} catch (err) {
console.error(err);
this.loading = false;
}
}
},
computed: {},
created() {
this.getList()
},
mounted() {
this.$nextTick(() => {
if (this.$refs["table"] && this.$refs["toolbar"]) {
this.$refs["table"].connect(this.$refs["toolbar"]);
}
});
},
}
</script>
<style scoped lang="scss">
</style>