25 changed files with 854 additions and 458 deletions
@ -1,58 +1,45 @@ |
|||||
import { ID, IDS, PageQuery, commonExport } from '@/api/base'; |
import { commonExport } from '@/api/base'; |
||||
import { defHttp } from '@/utils/http/axios'; |
import { defHttp } from '@/utils/http/axios'; |
||||
import { Dayjs } from 'dayjs'; |
|
||||
|
|
||||
enum Api { |
enum Api { |
||||
root = '/workflow/leave', |
root = '/platform/management', |
||||
list = '/workflow/leave/list', |
list = '/platform/management/list', |
||||
export = '/workflow/leave/export', |
export = '/workflow/leave/export', |
||||
|
getCheckType = '/platform/checkType/list', |
||||
|
getLargeRatingType = '/platform/largeRatingType/list', |
||||
} |
} |
||||
|
|
||||
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 list(params?: any) { |
||||
|
return defHttp.get({ url: Api.list, params }); |
||||
} |
} |
||||
|
|
||||
export function exportExcel(data: any) { |
export function exportExcel(data: any) { |
||||
return commonExport(Api.export, data); |
return commonExport(Api.export, data); |
||||
} |
} |
||||
|
|
||||
export function getInfo(id: ID) { |
export function getInfo(id: any) { |
||||
return defHttp.get<Leave>({ url: `${Api.root}/${id}` }); |
return defHttp.get({ url: `${Api.root}/${id}` }); |
||||
} |
} |
||||
|
|
||||
export function add(data: any) { |
export function add(data: any) { |
||||
return defHttp.post<Resp>({ url: Api.root, data }); |
return defHttp.post({ url: Api.root, data }); |
||||
} |
} |
||||
|
|
||||
export function update(data: any) { |
export function update(data: any) { |
||||
return defHttp.put<Resp>({ url: Api.root, data }); |
return defHttp.put({ url: Api.root, data }); |
||||
} |
} |
||||
|
|
||||
export function removeByIds(ids: IDS) { |
export function removeByIds(ids: any) { |
||||
return defHttp.deleteWithMsg<void>({ url: `${Api.root}/${ids.join(',')}` }); |
return defHttp.deleteWithMsg<void>({ url: `${Api.root}/${ids.join(',')}` }); |
||||
} |
} |
||||
|
export function getCheckType() { |
||||
|
return defHttp.get({ url: Api.getCheckType }); |
||||
|
} |
||||
|
export function getLargeRatingType() { |
||||
|
return defHttp.get({ url: Api.getLargeRatingType }); |
||||
|
} |
||||
|
@ -1,58 +1,65 @@ |
|||||
import { ID, IDS, PageQuery, commonExport } from '@/api/base'; |
import { commonExport } from '@/api/base'; |
||||
import { defHttp } from '@/utils/http/axios'; |
import { defHttp } from '@/utils/http/axios'; |
||||
import { Dayjs } from 'dayjs'; |
|
||||
|
|
||||
enum Api { |
enum Api { |
||||
root = '/workflow/leave', |
root = '/platform/evaluationInfo', |
||||
list = '/workflow/leave/list', |
list = '/platform/evaluationInfo/list', |
||||
export = '/workflow/leave/export', |
export = '/workflow/leave/export', |
||||
|
getProjectInfo = '/platform/projectInfo/getNames', |
||||
|
getIoCompanyNames = '/platform/inspectPlanInfo/getIoCompanyNames', |
||||
|
queryByFlag = '/platform/evaluationTemplate/queryByFlag', |
||||
|
batchEdit = '/platform/evaluationTemplate/batchEdit', |
||||
|
getEvaluationTemplate = '/platform/evaluationTemplate/getTree', |
||||
|
addBySelect = '/platform/evaluationInfo/addBySelect', |
||||
} |
} |
||||
|
|
||||
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 list(params?: any) { |
||||
|
return defHttp.get({ url: Api.list, params }); |
||||
} |
} |
||||
|
|
||||
export function exportExcel(data: any) { |
export function exportExcel(data: any) { |
||||
return commonExport(Api.export, data); |
return commonExport(Api.export, data); |
||||
} |
} |
||||
|
|
||||
export function getInfo(id: ID) { |
export function getInfo(id: any) { |
||||
return defHttp.get<Leave>({ url: `${Api.root}/${id}` }); |
return defHttp.get({ url: `${Api.root}/${id}` }); |
||||
} |
} |
||||
|
|
||||
export function add(data: any) { |
export function add(data: any) { |
||||
return defHttp.post<Resp>({ url: Api.root, data }); |
return defHttp.post({ url: Api.root, data }); |
||||
} |
} |
||||
|
|
||||
export function update(data: any) { |
export function update(data: any) { |
||||
return defHttp.put<Resp>({ url: Api.root, data }); |
return defHttp.put({ url: Api.root, data }); |
||||
} |
} |
||||
|
|
||||
export function removeByIds(ids: IDS) { |
export function removeByIds(ids: any) { |
||||
return defHttp.deleteWithMsg<void>({ url: `${Api.root}/${ids.join(',')}` }); |
return defHttp.deleteWithMsg<void>({ url: `${Api.root}/${ids.join(',')}` }); |
||||
} |
} |
||||
|
export function getProjectInfo() { |
||||
|
return defHttp.get({ url: Api.getProjectInfo }); |
||||
|
} |
||||
|
export function getIoCompanyNames() { |
||||
|
return defHttp.get({ url: Api.getIoCompanyNames }); |
||||
|
} |
||||
|
|
||||
|
export function queryByFlag(params?: any) { |
||||
|
return defHttp.get({ url: Api.queryByFlag, params }); |
||||
|
} |
||||
|
|
||||
|
export function batchEdit(data: any) { |
||||
|
return defHttp.put({ url: Api.batchEdit, data }); |
||||
|
} |
||||
|
|
||||
|
export function getEvaluationTemplate() { |
||||
|
return defHttp.get({ url: Api.getEvaluationTemplate}); |
||||
|
} |
||||
|
|
||||
|
export function addBySelect(data: any) { |
||||
|
return defHttp.post({ url: Api.addBySelect, data }); |
||||
|
} |
||||
|
@ -0,0 +1,87 @@ |
|||||
|
<template> |
||||
|
<a-modal |
||||
|
v-model:open="visible" |
||||
|
title="配置考核项" |
||||
|
@ok="handleOk" |
||||
|
width="80%" |
||||
|
@cancel="closeModal" |
||||
|
> |
||||
|
<div> |
||||
|
<a-tree |
||||
|
v-model:checkedKeys="checkedTree" |
||||
|
checkable |
||||
|
:tree-data="treeData" |
||||
|
@check="onCheck" |
||||
|
v-if="treeData.length" |
||||
|
:defaultExpandAll="true" |
||||
|
:fieldNames="{ |
||||
|
children: 'children', |
||||
|
title: 'name', |
||||
|
key: 'id', |
||||
|
disabled: 'disabled', |
||||
|
}" |
||||
|
> |
||||
|
</a-tree> |
||||
|
</div> |
||||
|
</a-modal> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { reactive, ref } from 'vue'; |
||||
|
import { getEvaluationTemplate,addBySelect } from './api'; |
||||
|
import { message } from 'ant-design-vue'; |
||||
|
export default { |
||||
|
setup() { |
||||
|
const visible = ref(false); |
||||
|
const treeData = ref([]); |
||||
|
const checkedTree = ref([]); |
||||
|
const flag = ref(''); |
||||
|
const onCheck = (checkedKeysValue, info) => { |
||||
|
console.log(checkedKeysValue, info); |
||||
|
}; |
||||
|
const handleOk = () => { |
||||
|
if(checkedTree.value&&checkedTree.value.length>0){ |
||||
|
const params = { |
||||
|
flag:flag.value, |
||||
|
checkList:checkedTree.value |
||||
|
} |
||||
|
addBySelect(params).then(_=>{ |
||||
|
message.success('操作成功') |
||||
|
closeModal() |
||||
|
}) |
||||
|
|
||||
|
}else{ |
||||
|
message.warning('请勾选配置项') |
||||
|
} |
||||
|
}; |
||||
|
const showModal = async (id) => { |
||||
|
visible.value = true; |
||||
|
const res = await getEvaluationTemplate(); |
||||
|
treeData.value = res.tree; |
||||
|
flag.value = id; |
||||
|
}; |
||||
|
const closeModal = () => { |
||||
|
checkedTree.value = []; |
||||
|
visible.value = false; |
||||
|
}; |
||||
|
return { |
||||
|
visible, |
||||
|
treeData, |
||||
|
checkedTree, |
||||
|
onCheck, |
||||
|
handleOk, |
||||
|
showModal, |
||||
|
closeModal, |
||||
|
flag, |
||||
|
}; |
||||
|
}, |
||||
|
}; |
||||
|
</script> |
||||
|
|
||||
|
<style scoped> |
||||
|
/* 可选样式调整 */ |
||||
|
.ant-modal-body { |
||||
|
max-width: 600px; |
||||
|
margin: 0 auto; |
||||
|
} |
||||
|
</style> |
Loading…
Reference in new issue