Commit b488df8b authored by qiyaxin's avatar qiyaxin

费用审批查询完善

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