10 changed files with 592 additions and 1 deletions
@ -0,0 +1,163 @@ |
|||||
|
<template> |
||||
|
<PageWrapper dense> |
||||
|
<BasicTable @register="registerTable"> |
||||
|
<template #toolbar> |
||||
|
<a-button |
||||
|
class="<sm:hidden" |
||||
|
@click="downloadExcel(exportExcel, '请假信息', getForm().getFieldsValue())" |
||||
|
v-auth="'workflow:leave:export'" |
||||
|
>导出</a-button |
||||
|
> |
||||
|
<a-button |
||||
|
class="<sm:hidden" |
||||
|
type="primary" |
||||
|
danger |
||||
|
@click="multipleRemove(removeByIds)" |
||||
|
:disabled="!selected" |
||||
|
v-auth="'workflow:leave:remove'" |
||||
|
>删除</a-button |
||||
|
> |
||||
|
<a-button type="primary" @click="handleAdd" v-auth="'workflow:leave:add'">新增</a-button> |
||||
|
</template> |
||||
|
<template #bodyCell="{ column, record }"> |
||||
|
<template v-if="column && record && column.key === 'action'"> |
||||
|
<!-- 完成/撤销不显示 --> |
||||
|
<TableAction |
||||
|
stopButtonPropagation |
||||
|
:actions="[ |
||||
|
{ |
||||
|
label: '修改', |
||||
|
icon: IconEnum.EDIT, |
||||
|
auth: 'workflow:leave:edit', |
||||
|
onClick: handleEdit.bind(null, record), |
||||
|
ifShow: |
||||
|
record.status !== 'invalid' && |
||||
|
record.status !== 'finish' && |
||||
|
record.status !== 'waiting' && |
||||
|
record.status !== 'termination', |
||||
|
}, |
||||
|
{ |
||||
|
label: '记录', |
||||
|
icon: IconEnum.PREVIEW, |
||||
|
auth: 'workflow:leave:list', |
||||
|
onClick: handleToApproveRecord.bind(null, record), |
||||
|
ifShow: record.status !== 'draft' && record.status !== 'cancel', |
||||
|
}, |
||||
|
{ |
||||
|
label: '撤销', |
||||
|
icon: IconEnum.EDIT, |
||||
|
danger: true, |
||||
|
auth: 'workflow:leave:edit', |
||||
|
ifShow: record.status === 'waiting', |
||||
|
popConfirm: { |
||||
|
placement: 'left', |
||||
|
title: `是否撤销当前申请?`, |
||||
|
confirm: handleRevoke.bind(null, record), |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
label: '删除', |
||||
|
icon: IconEnum.DELETE, |
||||
|
danger: true, |
||||
|
auth: 'workflow:leave:remove', |
||||
|
ifShow: |
||||
|
record.status !== 'invalid' && |
||||
|
record.status !== 'finish' && |
||||
|
record.status !== 'waiting' && |
||||
|
record.status !== 'termination', |
||||
|
popConfirm: { |
||||
|
placement: 'left', |
||||
|
title: `是否删除请假[${record.id}]?`, |
||||
|
confirm: handleDelete.bind(null, record), |
||||
|
}, |
||||
|
}, |
||||
|
]" |
||||
|
/> |
||||
|
</template> |
||||
|
</template> |
||||
|
</BasicTable> |
||||
|
</PageWrapper> |
||||
|
</template> |
||||
|
|
||||
|
<script setup lang="ts"> |
||||
|
import { PageWrapper } from '@/components/Page'; |
||||
|
import { BasicTable, useTable, TableAction } from '@/components/Table'; |
||||
|
import { list, exportExcel, removeByIds } from './api'; |
||||
|
import { downloadExcel } from '@/utils/file/download'; |
||||
|
import { formSchemas, columns } from './data'; |
||||
|
import { IconEnum } from '@/enums/appEnum'; |
||||
|
import { useGo } from '@/hooks/web/usePage'; |
||||
|
import { cancelProcessApply } from '@/api/workflow/processInstance'; |
||||
|
import { PageEnum } from '@/enums/pageEnum'; |
||||
|
|
||||
|
defineOptions({ name: 'Leave' }); |
||||
|
|
||||
|
const [registerTable, { reload, multipleRemove, selected, getForm }] = useTable({ |
||||
|
rowSelection: { |
||||
|
type: 'checkbox', |
||||
|
getCheckboxProps: (record: Recordable) => ({ |
||||
|
// 撤销/草稿 可删除 |
||||
|
disabled: |
||||
|
record.status === 'invalid' || |
||||
|
record.status === 'finish' || |
||||
|
record.status === 'waiting' || |
||||
|
record.status === 'termination', |
||||
|
}), |
||||
|
}, |
||||
|
title: '请假列表', |
||||
|
titleHelpMessage: [ |
||||
|
'先到流程定义部署 [后端根目录/script/bpmn/模型.zip] 后再使用!', |
||||
|
'切换不同类型的流程(会签/普通)等, 到[流程定义-绑定业务]设置表名为[test_leave]', |
||||
|
], |
||||
|
api: list, |
||||
|
showIndexColumn: false, |
||||
|
rowKey: 'id', |
||||
|
useSearchForm: true, |
||||
|
formConfig: { |
||||
|
schemas: formSchemas, |
||||
|
name: 'leave', |
||||
|
baseColProps: { |
||||
|
xs: 24, |
||||
|
sm: 24, |
||||
|
md: 24, |
||||
|
lg: 6, |
||||
|
}, |
||||
|
}, |
||||
|
columns: columns, |
||||
|
actionColumn: { |
||||
|
width: 200, |
||||
|
title: '操作', |
||||
|
key: 'action', |
||||
|
fixed: 'right', |
||||
|
}, |
||||
|
}); |
||||
|
|
||||
|
function handleEdit(record: Recordable) { |
||||
|
go({ path: '/workflow/leaveEdit/index' as PageEnum, query: { id: record.id, type: 'update' } }); |
||||
|
} |
||||
|
|
||||
|
function handleAdd() { |
||||
|
go({ path: '/workflow/leaveEdit/index' as PageEnum, query: { type: 'add' } }); |
||||
|
} |
||||
|
|
||||
|
async function handleDelete(record: Recordable) { |
||||
|
await removeByIds([record.id]); |
||||
|
await reload(); |
||||
|
} |
||||
|
|
||||
|
// 前往审批记录页面 |
||||
|
const go = useGo(); |
||||
|
function handleToApproveRecord(record: Recordable) { |
||||
|
// 前往审批记录页面 |
||||
|
const id = record.id; |
||||
|
go({ path: '/workflow/leaveEdit/index' as PageEnum, query: { id, type: 'preview' } }); |
||||
|
} |
||||
|
|
||||
|
// 撤销 |
||||
|
async function handleRevoke(record: Recordable) { |
||||
|
await cancelProcessApply(record.id); |
||||
|
await reload(); |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style scoped></style> |
@ -0,0 +1,58 @@ |
|||||
|
import { ID, IDS, PageQuery, commonExport } from '@/api/base'; |
||||
|
import { defHttp } from '@/utils/http/axios'; |
||||
|
import { Dayjs } from 'dayjs'; |
||||
|
|
||||
|
enum Api { |
||||
|
root = '/workflow/leave', |
||||
|
list = '/workflow/leave/list', |
||||
|
export = '/workflow/leave/export', |
||||
|
} |
||||
|
|
||||
|
export interface Leave { |
||||
|
id: string; |
||||
|
leaveType: string; |
||||
|
startDate: string; |
||||
|
endDate: string; |
||||
|
leaveDays: number; |
||||
|
remark: string; |
||||
|
processInstanceVo?: any; |
||||
|
dateTime?: [string, string] | [Dayjs, Dayjs]; |
||||
|
} |
||||
|
|
||||
|
export interface Resp { |
||||
|
createDept: number; |
||||
|
createBy: number; |
||||
|
createTime: string; |
||||
|
updateBy: number; |
||||
|
updateTime: string; |
||||
|
id: string; |
||||
|
leaveType: string; |
||||
|
startDate: string; |
||||
|
endDate: string; |
||||
|
leaveDays: number; |
||||
|
remark?: any; |
||||
|
} |
||||
|
|
||||
|
export function list(params?: PageQuery) { |
||||
|
return defHttp.get<Leave[]>({ url: Api.list, params }); |
||||
|
} |
||||
|
|
||||
|
export function exportExcel(data: any) { |
||||
|
return commonExport(Api.export, data); |
||||
|
} |
||||
|
|
||||
|
export function getInfo(id: ID) { |
||||
|
return defHttp.get<Leave>({ url: `${Api.root}/${id}` }); |
||||
|
} |
||||
|
|
||||
|
export function add(data: any) { |
||||
|
return defHttp.post<Resp>({ url: Api.root, data }); |
||||
|
} |
||||
|
|
||||
|
export function update(data: any) { |
||||
|
return defHttp.put<Resp>({ url: Api.root, data }); |
||||
|
} |
||||
|
|
||||
|
export function removeByIds(ids: IDS) { |
||||
|
return defHttp.deleteWithMsg<void>({ url: `${Api.root}/${ids.join(',')}` }); |
||||
|
} |
@ -0,0 +1,87 @@ |
|||||
|
import { BasicColumn } from '@/components/Table'; |
||||
|
import { FormSchema } from '@/components/Form'; |
||||
|
|
||||
|
export const formSchemas: FormSchema[] = [ |
||||
|
{ |
||||
|
field: 'projectName', |
||||
|
label: '项目名称', |
||||
|
component: 'Select', |
||||
|
componentProps: { |
||||
|
options: [ |
||||
|
{ |
||||
|
value: '1', |
||||
|
label: '2323', |
||||
|
}, |
||||
|
{ |
||||
|
value: '2', |
||||
|
label: '2323', |
||||
|
}, |
||||
|
{ |
||||
|
value: '3', |
||||
|
label: '2323', |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
field: 'IOCompany', |
||||
|
label: '运维单位', |
||||
|
component: 'Select', |
||||
|
componentProps: { |
||||
|
options: [ |
||||
|
{ |
||||
|
value: '1', |
||||
|
label: '2323', |
||||
|
}, |
||||
|
{ |
||||
|
value: '2', |
||||
|
label: '2323', |
||||
|
}, |
||||
|
{ |
||||
|
value: '3', |
||||
|
label: '2323', |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
field: 'plaDate', |
||||
|
label: '计划日期', |
||||
|
component: 'RangePicker', |
||||
|
}, |
||||
|
]; |
||||
|
|
||||
|
export const columns: BasicColumn[] = [ |
||||
|
{ |
||||
|
title: '合同名称', |
||||
|
dataIndex: 'contractName', |
||||
|
}, |
||||
|
{ |
||||
|
title: '项目名称', |
||||
|
dataIndex: 'projectName', |
||||
|
}, |
||||
|
{ |
||||
|
title: '计划描述', |
||||
|
dataIndex: 'description', |
||||
|
}, |
||||
|
{ |
||||
|
title: '开始日期', |
||||
|
dataIndex: 'startDate', |
||||
|
}, |
||||
|
{ |
||||
|
title: '结束日期', |
||||
|
dataIndex: 'endDate', |
||||
|
}, |
||||
|
{ |
||||
|
title: '频次', |
||||
|
dataIndex: 'frequency', |
||||
|
}, |
||||
|
{ |
||||
|
title: '状态', |
||||
|
dataIndex: 'status', |
||||
|
}, |
||||
|
{ |
||||
|
title: '完成情况', |
||||
|
dataIndex: 'progress', |
||||
|
}, |
||||
|
]; |
@ -0,0 +1,69 @@ |
|||||
|
<template> |
||||
|
<PageWrapper dense> |
||||
|
<BasicTable @register="registerTable"> |
||||
|
<template #toolbar> |
||||
|
<a-button |
||||
|
class="<sm:hidden" |
||||
|
@click="downloadExcel(exportExcel, '请假信息', getForm().getFieldsValue())" |
||||
|
v-auth="'workflow:leave:export'" |
||||
|
>导出</a-button |
||||
|
> |
||||
|
|
||||
|
<a-button type="primary" @click="handleAdd" v-auth="'workflow:leave:add'">新增</a-button> |
||||
|
</template> |
||||
|
<template #bodyCell="{ column, record }"> |
||||
|
<template v-if="column && record && column.key === 'action'"> </template> |
||||
|
</template> |
||||
|
</BasicTable> |
||||
|
</PageWrapper> |
||||
|
</template> |
||||
|
|
||||
|
<script setup lang="ts"> |
||||
|
import { PageWrapper } from '@/components/Page'; |
||||
|
import { BasicTable, useTable } from '@/components/Table'; |
||||
|
import { list, exportExcel } from './api'; |
||||
|
import { downloadExcel } from '@/utils/file/download'; |
||||
|
import { formSchemas, columns } from './data'; |
||||
|
import { useGo } from '@/hooks/web/usePage'; |
||||
|
import { PageEnum } from '@/enums/pageEnum'; |
||||
|
|
||||
|
defineOptions({ name: 'Patroling' }); |
||||
|
|
||||
|
const [registerTable, { reload, getForm }] = useTable({ |
||||
|
rowSelection: { |
||||
|
type: 'checkbox', |
||||
|
}, |
||||
|
title: '巡检进行', |
||||
|
api: list, |
||||
|
showIndexColumn: true, |
||||
|
rowKey: 'id', |
||||
|
useSearchForm: true, |
||||
|
formConfig: { |
||||
|
schemas: formSchemas, |
||||
|
name: 'patroling', |
||||
|
baseColProps: { |
||||
|
xs: 24, |
||||
|
sm: 24, |
||||
|
md: 24, |
||||
|
lg: 6, |
||||
|
}, |
||||
|
}, |
||||
|
columns: columns, |
||||
|
actionColumn: { |
||||
|
width: 200, |
||||
|
title: '操作', |
||||
|
key: 'action', |
||||
|
fixed: 'right', |
||||
|
}, |
||||
|
}); |
||||
|
|
||||
|
function handleAdd() { |
||||
|
go({ path: '/workflow/leaveEdit/index' as PageEnum, query: { type: 'add' } }); |
||||
|
reload(); |
||||
|
} |
||||
|
|
||||
|
// 前往审批记录页面 |
||||
|
const go = useGo(); |
||||
|
</script> |
||||
|
|
||||
|
<style scoped></style> |
@ -0,0 +1,58 @@ |
|||||
|
import { ID, IDS, PageQuery, commonExport } from '@/api/base'; |
||||
|
import { defHttp } from '@/utils/http/axios'; |
||||
|
import { Dayjs } from 'dayjs'; |
||||
|
|
||||
|
enum Api { |
||||
|
root = '/workflow/leave', |
||||
|
list = '/workflow/leave/list', |
||||
|
export = '/workflow/leave/export', |
||||
|
} |
||||
|
|
||||
|
export interface Leave { |
||||
|
id: string; |
||||
|
leaveType: string; |
||||
|
startDate: string; |
||||
|
endDate: string; |
||||
|
leaveDays: number; |
||||
|
remark: string; |
||||
|
processInstanceVo?: any; |
||||
|
dateTime?: [string, string] | [Dayjs, Dayjs]; |
||||
|
} |
||||
|
|
||||
|
export interface Resp { |
||||
|
createDept: number; |
||||
|
createBy: number; |
||||
|
createTime: string; |
||||
|
updateBy: number; |
||||
|
updateTime: string; |
||||
|
id: string; |
||||
|
leaveType: string; |
||||
|
startDate: string; |
||||
|
endDate: string; |
||||
|
leaveDays: number; |
||||
|
remark?: any; |
||||
|
} |
||||
|
|
||||
|
export function list(params?: PageQuery) { |
||||
|
return defHttp.get<Leave[]>({ url: Api.list, params }); |
||||
|
} |
||||
|
|
||||
|
export function exportExcel(data: any) { |
||||
|
return commonExport(Api.export, data); |
||||
|
} |
||||
|
|
||||
|
export function getInfo(id: ID) { |
||||
|
return defHttp.get<Leave>({ url: `${Api.root}/${id}` }); |
||||
|
} |
||||
|
|
||||
|
export function add(data: any) { |
||||
|
return defHttp.post<Resp>({ url: Api.root, data }); |
||||
|
} |
||||
|
|
||||
|
export function update(data: any) { |
||||
|
return defHttp.put<Resp>({ url: Api.root, data }); |
||||
|
} |
||||
|
|
||||
|
export function removeByIds(ids: IDS) { |
||||
|
return defHttp.deleteWithMsg<void>({ url: `${Api.root}/${ids.join(',')}` }); |
||||
|
} |
@ -0,0 +1,87 @@ |
|||||
|
import { BasicColumn } from '@/components/Table'; |
||||
|
import { FormSchema } from '@/components/Form'; |
||||
|
|
||||
|
export const formSchemas: FormSchema[] = [ |
||||
|
{ |
||||
|
field: 'projectName', |
||||
|
label: '项目名称', |
||||
|
component: 'Select', |
||||
|
componentProps: { |
||||
|
options: [ |
||||
|
{ |
||||
|
value: '1', |
||||
|
label: '2323', |
||||
|
}, |
||||
|
{ |
||||
|
value: '2', |
||||
|
label: '2323', |
||||
|
}, |
||||
|
{ |
||||
|
value: '3', |
||||
|
label: '2323', |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
field: 'ioCompany', |
||||
|
label: '运维单位', |
||||
|
component: 'Select', |
||||
|
componentProps: { |
||||
|
options: [ |
||||
|
{ |
||||
|
value: '1', |
||||
|
label: '2323', |
||||
|
}, |
||||
|
{ |
||||
|
value: '2', |
||||
|
label: '2323', |
||||
|
}, |
||||
|
{ |
||||
|
value: '3', |
||||
|
label: '2323', |
||||
|
}, |
||||
|
], |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
field: 'planDate', |
||||
|
label: '计划日期', |
||||
|
component: 'RangePicker', |
||||
|
}, |
||||
|
]; |
||||
|
|
||||
|
export const columns: BasicColumn[] = [ |
||||
|
{ |
||||
|
title: '合同名称', |
||||
|
dataIndex: 'contractName', |
||||
|
}, |
||||
|
{ |
||||
|
title: '项目名称', |
||||
|
dataIndex: 'projectName', |
||||
|
}, |
||||
|
{ |
||||
|
title: '计划描述', |
||||
|
dataIndex: 'description', |
||||
|
}, |
||||
|
{ |
||||
|
title: '开始日期', |
||||
|
dataIndex: 'startDate', |
||||
|
}, |
||||
|
{ |
||||
|
title: '结束日期', |
||||
|
dataIndex: 'endDate', |
||||
|
}, |
||||
|
{ |
||||
|
title: '频次', |
||||
|
dataIndex: 'frequency', |
||||
|
}, |
||||
|
{ |
||||
|
title: '状态', |
||||
|
dataIndex: 'status', |
||||
|
}, |
||||
|
{ |
||||
|
title: '完成情况', |
||||
|
dataIndex: 'progress', |
||||
|
}, |
||||
|
]; |
@ -0,0 +1,69 @@ |
|||||
|
<template> |
||||
|
<PageWrapper dense> |
||||
|
<BasicTable @register="registerTable"> |
||||
|
<template #toolbar> |
||||
|
<a-button |
||||
|
class="<sm:hidden" |
||||
|
@click="downloadExcel(exportExcel, '请假信息', getForm().getFieldsValue())" |
||||
|
v-auth="'workflow:leave:export'" |
||||
|
>导出</a-button |
||||
|
> |
||||
|
|
||||
|
<a-button type="primary" @click="handleAdd" v-auth="'workflow:leave:add'">新增</a-button> |
||||
|
</template> |
||||
|
<template #bodyCell="{ column, record }"> |
||||
|
<template v-if="column && record && column.key === 'action'"> </template> |
||||
|
</template> |
||||
|
</BasicTable> |
||||
|
</PageWrapper> |
||||
|
</template> |
||||
|
|
||||
|
<script setup lang="ts"> |
||||
|
import { PageWrapper } from '@/components/Page'; |
||||
|
import { BasicTable, useTable } from '@/components/Table'; |
||||
|
import { list, exportExcel } from './api'; |
||||
|
import { downloadExcel } from '@/utils/file/download'; |
||||
|
import { formSchemas, columns } from './data'; |
||||
|
import { useGo } from '@/hooks/web/usePage'; |
||||
|
import { PageEnum } from '@/enums/pageEnum'; |
||||
|
|
||||
|
defineOptions({ name: 'OrderSend' }); |
||||
|
|
||||
|
const [registerTable, { reload, getForm }] = useTable({ |
||||
|
rowSelection: { |
||||
|
type: 'checkbox', |
||||
|
}, |
||||
|
title: '工单派遣', |
||||
|
api: list, |
||||
|
showIndexColumn: true, |
||||
|
rowKey: 'id', |
||||
|
useSearchForm: true, |
||||
|
formConfig: { |
||||
|
schemas: formSchemas, |
||||
|
name: 'patroling', |
||||
|
baseColProps: { |
||||
|
xs: 24, |
||||
|
sm: 24, |
||||
|
md: 24, |
||||
|
lg: 6, |
||||
|
}, |
||||
|
}, |
||||
|
columns: columns, |
||||
|
actionColumn: { |
||||
|
width: 200, |
||||
|
title: '操作', |
||||
|
key: 'action', |
||||
|
fixed: 'right', |
||||
|
}, |
||||
|
}); |
||||
|
|
||||
|
function handleAdd() { |
||||
|
go({ path: '/workflow/leaveEdit/index' as PageEnum, query: { type: 'add' } }); |
||||
|
reload(); |
||||
|
} |
||||
|
|
||||
|
// 前往审批记录页面 |
||||
|
const go = useGo(); |
||||
|
</script> |
||||
|
|
||||
|
<style scoped></style> |
Loading…
Reference in new issue