Commit b488df8b authored by qiyaxin's avatar qiyaxin

费用审批查询完善

parent 48772697
......@@ -215,8 +215,10 @@ const allList = ref([]) // 流程图内容,值和角色id
const total = ref(0);
const projectNameList = ref([]);
const projectUserNameList = ref([]);
// 更多搜索框
const isExpanded = ref(false);
// 切换展开/折叠状态
const toggleSearch = () => {
isExpanded.value = !isExpanded.value;
......@@ -258,7 +260,7 @@ const queryParams = reactive({
const getAllProjectName=()=> {
getProjectName(queryParams).then(response => {
projectNameList.value = response.data;
console.log("项目名称",projectNameList.value)
// console.log("项目名称",projectNameList.value)
});
}
getAllProjectName()
......@@ -267,10 +269,11 @@ getAllProjectName()
const getAllProjectUserName=()=> {
getProjectManagerName(queryParams).then(response => {
projectUserNameList.value = response.data;
console.log("项目经理",projectUserNameList.value)
// console.log("项目经理",projectUserNameList.value)
});
}
getAllProjectUserName()
// 搜索按钮
function handleQuery() {
queryParams.pageNum = 1;
......@@ -291,7 +294,7 @@ const resetQuery = () => {
//获取所有流程列表,根据审批id
const getNodeList = ()=>{
getApproveNodeList(23).then(res=>{
console.log("项目费用报销-所有流程",res.data)
// console.log("项目费用报销-所有流程",res.data)
allList.value = res.data.nodeList
list.value = res.data.nodeList.map(item=>{
return item.roleName
......@@ -302,7 +305,7 @@ const getNodeList = ()=>{
//获取当前用户角色信息
const getRoleInfo = ()=>{
getRoleId().then(res=>{
console.log("项目费用报销-角色信息",res.data)
// console.log("项目费用报销-角色信息",res.data)
currentUserRoleInfoList.value = res.data
})
}
......@@ -311,7 +314,7 @@ const getRoleInfo = ()=>{
const ReimbursementRequestList = ref([]);
const getList=()=> {
listTripApplication(queryParams).then(response => {
console.log("出差申请-列表",response.rows)
// console.log("出差申请-列表",response.rows)
total.value = response.total
ReimbursementRequestList.value = response.rows
for(let i in ReimbursementRequestList.value){
......@@ -322,7 +325,6 @@ const getList=()=> {
});
}
//表格多选
const handleSelectionChange = (val) => {
passObjList.length = 0
......@@ -361,14 +363,11 @@ const rowSelectable = (row) => {
//获取当前审批状态 返回值0表示当前用户可以审核,大于0已经审核过了,小于0表示表示还没到当前用户
const approvalStatusChange = (status,currentNodeId)=>{
//如果状态为未通过,那么这里返回-999
if(status === 1) return -999
if(status === 3) return 999
// 先根据每个节点的激活nodeid查找对应的角色id---也就是可以申请的角色
let activeRoleId = allList.value.find(item =>item.nodeId === currentNodeId).roleId
let lastCurrentRoleId = currentUserRoleInfoList.value[currentUserRoleInfoList.value.length - 1].roleId
//激活id的下标减去当前登录用户最后一个角色id的在整体审批列表差
......@@ -376,7 +375,6 @@ const approvalStatusChange = (status,currentNodeId)=>{
return allList.value.findIndex(item =>item.roleId === activeRoleId) - allList.value.findIndex(item =>item.roleId === lastCurrentRoleId)
}
//获取列表第一个顶部信息
const getTopApproveInfo = ()=>{
let item2 = ReimbursementRequestList.value[0]
......@@ -423,6 +421,7 @@ const oneClickPass = ()=>{
}
})
}
//通过
const passProjectCost = (row)=>{
let currentAuditRoleId = row.currentAuditRoleId
......@@ -463,6 +462,7 @@ const reject = (row)=>{
dialogFormVisible.value = true
rejectObj.tripApplicationId = row.id
}
//确定驳回
const sureReject = ()=>{
......@@ -488,18 +488,16 @@ const sureReject = ()=>{
getList()
})
}
}
//一键驳回
const oneClickNotPass = ()=>{
if(!passObjList.length) return ElMessage({
message: '请先选择数据项',
type: 'error'
})
oneClickFlag = true
dialogFormVisible.value = true
}
//取消对话框
......
......@@ -7,39 +7,44 @@
<el-select
v-model="queryParams.projectName"
placeholder="请选择项目名称"
style="width: 220px"
clearable
filterable
style="width: 220px"
>
<el-option
v-for="item in projectNameList"
:key="item.projectName"
:label="item.projectName"
:value="item.projectName"/>
:value="item.projectName"
style="width: 220px"
/>
</el-select>
</el-form-item>
<el-form-item label="项目经理" prop="projectManagerId">
<el-form-item label="项目经理" prop="projectUserName">
<el-select
v-model="queryParams.projectUserName"
filterable
placeholder="请选择项目经理"
style="width: 220px"
clearable
>
<el-option
v-for="item in projectManagerNameList"
v-for="item in projectUserNameList"
:key="item.projectManagerName"
:label="item.projectManagerName"
:value="item.projectManagerName"/>
:value="item.projectManagerName"
/>
</el-select>
</el-form-item>
<el-form-item label="审批状态" prop="projectStatus">
<el-form-item label="审批状态" prop="status">
<el-select
v-model="queryParams.projectStatus"
v-model="queryParams.status"
placeholder="请选择项目状态"
style="width: 220px"
clearable
>
<el-option
v-for="dict in project_status"
v-for="dict in cost_daily_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
......@@ -157,7 +162,6 @@
</div>
</div>
<!-- 驳回弹出框-->
<el-dialog style="width: 745px;height: 300px;margin-top: 300px" :fullscreen="true" v-model="dialogFormVisible" title="驳回" >
<template #header>
......@@ -186,16 +190,26 @@ import {
getProjectName,
getRoleId,
travelOnBusinessPass,
travelOnBusinessNotPass
travelOnBusinessNotPass, getProjectManagerName
} from "../../../../api/examineAndApprove/examineAndApprove.js";
const { project_status,cost_daily_status,project_type} = proxy.useDict('project_status', 'cost_daily_status','project_type');
import {listTripApplication, listTripReimburse} from "../../../../api/costManage/cost.js";
import {useRouter} from "vue-router";
import {ArrowDown} from "@element-plus/icons-vue";
const router = useRouter();
const list = ref([]) // 流程图内容,只有值
const allList = ref([]) // 流程图内容,值和角色id
const total = ref(0);
const projectNameList = ref([]);
const projectUserNameList = ref([]);
// 更多搜索框
const isExpanded = ref(false);
// 切换展开/折叠状态
const toggleSearch = () => {
isExpanded.value = !isExpanded.value;
}
//当前登录用户角色组
const currentUserRoleInfoList = ref([])
......@@ -218,14 +232,15 @@ const dialogFormVisible = ref(false)
const changProjectNumber = ref('')
const stepActive = ref(1)
const queryParams = reactive({
pageNum:1,
pageSize:10,
projectName:null,
projectType:null,
status:null
pageNum: 1,
pageSize: 10,
projectNumber: null,
projectName: null,
projectType: null,
projectUserName: null,
status: null,
})
// 搜索表单——获取所有项目名称
const getAllProjectName=()=> {
getProjectName(queryParams).then(response => {
......@@ -234,18 +249,36 @@ const getAllProjectName=()=> {
});
}
getAllProjectName()
// 搜索表单——获取所有项目经理
const getAllProjectUserName=()=> {
getProjectManagerName(queryParams).then(response => {
projectUserNameList.value = response.data;
// console.log("项目经理",projectUserNameList.value)
});
}
getAllProjectUserName()
// 搜索按钮
function handleQuery() {
queryParams.pageNum = 1;
getList();
}
// 重置表单
const reset = () => {
const resetQuery = () => {
queryParams.projectNumber = null
queryParams.projectName = null
queryParams.projectType = null
queryParams.projectUserName = null
queryParams.status = null
// getList()
getList()
}
//获取所有流程列表,根据审批id
const getNodeList = ()=>{
getApproveNodeList(23).then(res=>{
console.log("项目费用报销-所有流程",res.data)
// console.log("差旅报销-所有流程",res.data)
allList.value = res.data.nodeList
list.value = res.data.nodeList.map(item=>{
return item.roleName
......@@ -256,18 +289,18 @@ const getNodeList = ()=>{
//获取当前用户角色信息
const getRoleInfo = ()=>{
getRoleId().then(res=>{
console.log("项目费用报销-角色信息",res.data)
// console.log("差旅报销-角色信息",res.data)
currentUserRoleInfoList.value = res.data
})
}
// 列表
const ReimbursementRequestList = reactive([]);
const ReimbursementRequestList = ref([]);
const getList=()=> {
listTripReimburse(queryParams).then(response => {
console.log("差旅报销-列表",response.rows)
total.value = response.total
Object.assign(ReimbursementRequestList, response.rows);
ReimbursementRequestList.value = response.rows
for(let i in ReimbursementRequestList){
console.log(ReimbursementRequestList[i])
ReimbursementRequestList[i].currentStatus = approvalStatusChange(ReimbursementRequestList[i].status,ReimbursementRequestList[i].currentAuditRoleId)
......@@ -276,7 +309,6 @@ const getList=()=> {
});
}
//表格多选
const handleSelectionChange = (val) => {
passObjList.length = 0
......@@ -284,7 +316,6 @@ const handleSelectionChange = (val) => {
let currentAuditRoleId = item.currentAuditRoleId
//获取currentAuditRoleId的下标
let index = allList.value.findIndex(item=>item.nodeId === currentAuditRoleId)
let obj = {
//项目费用id
travelOnBusinessId:item.id,
......@@ -304,9 +335,9 @@ const handleSelectionChange = (val) => {
obj.isEndApproval = false
}
passObjList.push(obj)
}
};
//只有待审批的表格可选
const rowSelectable = (row) => {
return row.currentStatus === 0
......@@ -315,14 +346,11 @@ const rowSelectable = (row) => {
//获取当前审批状态 返回值0表示当前用户可以审核,大于0已经审核过了,小于0表示表示还没到当前用户
const approvalStatusChange = (status,currentNodeId)=>{
//如果状态为未通过,那么这里返回-999
if(status === 1) return -999
if(status === 3) return 999
// 先根据每个节点的激活nodeid查找对应的角色id---也就是可以申请的角色
let activeRoleId = allList.value.find(item =>item.nodeId === currentNodeId).roleId
let lastCurrentRoleId = currentUserRoleInfoList.value[currentUserRoleInfoList.value.length - 1].roleId
//激活id的下标减去当前登录用户最后一个角色id的在整体审批列表差
......@@ -330,7 +358,6 @@ const approvalStatusChange = (status,currentNodeId)=>{
return allList.value.findIndex(item =>item.roleId === activeRoleId) - allList.value.findIndex(item =>item.roleId === lastCurrentRoleId)
}
//获取列表第一个顶部信息
const getTopApproveInfo = ()=>{
let item2 = ReimbursementRequestList[0]
......@@ -377,6 +404,7 @@ const oneClickPass = ()=>{
}
})
}
//通过
const passProjectCost = (row)=>{
let currentAuditRoleId = row.currentAuditRoleId
......@@ -444,6 +472,7 @@ const sureReject = ()=>{
}
}
//一键驳回
const oneClickNotPass = ()=>{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment