Commit 2ea918d9 authored by 祁正's avatar 祁正

差旅审批-通过

parent 44c02373
......@@ -103,7 +103,7 @@
</div>
</div>
<!-- 表格数据 -->
<el-table @cell-mouse-enter="handleHover" @cell-mouse-leave="handleLeave" v-loading="loading" :data="tripReimburseList" border style="width: 100%" @selection-change="handleSelectionChange">
<el-table @cell-mouse-enter="handleHover" @cell-mouse-leave="handleLeave" v-loading="loading" :data="ReimbursementRequestList" border style="width: 100%" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="40" align="right" :selectable="rowSelectable"/>
<el-table-column label="申请人" align="center" prop="updateBy" fixed min-width="120"/>
<el-table-column label="项目编号" align="center" prop="projectNumber" min-width="160"/>
......@@ -155,16 +155,16 @@
</div>
</div>
<!-- 驳回弹出框-->
<el-dialog style="width: 745px;height: 300px;margin-top: 300px" :fullscreen="true" v-model="dialogFormVisible" title="驳回" :top="'30'" width="700" >
<el-dialog style="width: 745px;height: 300px;margin-top: 300px" :fullscreen="true" v-model="dialogFormVisible" title="驳回" >
<template #header>
<div style="margin-bottom:30px;color: #0062FF;font-family: PingFangSC-Regular;font-weight: 400;font-size: 20px;">驳回</div>
<div class="text_weight">驳回<el-divider /></div>
</template>
<el-form :model="form">
<el-form-item label="驳回原因" >
<el-input :rows="4" type="textarea" v-model="form.name" placeholder="请输入驳回原因" />
</el-form-item>
</el-form>
<div style="padding: 5px;display: flex;flex-direction:column;">
<div class="text">驳回原因</div>
<div style="width: 95%;margin-top:10px"> <el-input v-model="rejectObj.groundsForRejection" :rows="3" type="textarea" placeholder="请输入驳回原因" /></div>
</div>
<template #footer>
<div style="position: absolute;left: 35%;display: flex">
<el-button @click="cancelReject" class="btn-B">取消</el-button>
......@@ -174,36 +174,24 @@
</el-dialog>
</template>
<script setup>
import {getCurrentInstance, onMounted, reactive, ref} from "vue";
import {ArrowDown} from "@element-plus/icons-vue";
<script setup >
import {onMounted, reactive, ref} from "vue";
const { proxy } = getCurrentInstance();
import FlowChart from '@/components/FlowChart/index.vue'
import {useRouter} from "vue-router";
import {ElMessage} from "element-plus";
import {
getApproveNodeList,
getProjectManagerName,
getProjectName,
getRoleId,
travelOnBusinessNotPass,
travelOnBusinessPass,
tripApplicationApproval,
tripApplicationPassNotPass
travelOnBusinessNotPass
} 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 {ElMessage} from "element-plus";
const router = useRouter();
const { proxy } = getCurrentInstance();
const {cost_daily_status, project_status, project_type } = proxy.useDict('cost_daily_status','project_status', 'project_type');
const list = ref([]) // 流程图内容,只有值
const allList = ref([]) // 流程图内容,值和角色id
const tripReimburseList = reactive([]);
const total = ref(0);
const loading = ref(true);
const projectNameList = ref([]);
const projectManagerNameList = ref([]);
//当前登录用户角色组
const currentUserRoleInfoList = ref([])
......@@ -213,65 +201,47 @@ const passObjList = []
//驳回对象
let rejectObj = reactive({
projectCostId :null,
travelOnBusinessId :null,
groundsForRejection:null
})
//是否一键驳回标识 false 不是
let oneClickFlag = false
// 弹出框
//弹出框
const dialogFormVisible = ref(false)
// 更多搜索框
const isExpanded = ref(false);
const changProjectNumber = ref('')
const stepActive = ref(1)
const queryParams = reactive({
pageNum: 1,
pageSize: 10,
projectNumber: null,
projectName: null,
projectType: null,
projectUserName: null,
status: null,
pageNum:1,
pageSize:10,
projectName:null,
projectType:null,
status:null
})
// 切换展开/折叠状态
const toggleSearch = () => {
isExpanded.value = !isExpanded.value;
}
// 搜索表单——获取所有项目名称
const getAllProjectName=()=> {
getProjectName(queryParams).then(response => {
console.log("出差-所有项目名称",response.data)
projectNameList.value = response.data;
// console.log("项目名称",projectNameList.value)
});
}
getAllProjectName()
// 搜索表单——获取所有项目名经理
const getAllProjectManagerName=()=> {
getProjectManagerName(queryParams).then(response => {
console.log("出差-所有项目经理",response.data)
projectManagerNameList.value = response.data;
});
}
getAllProjectManagerName()
// 重置表单
const reset = () => {
queryParams.projectName = null
queryParams.projectType = null
queryParams.status = null
getList()
// getList()
}
//获取所有流程列表,根据审批id(差旅报销的流程配置id是24)
//获取所有流程列表,根据审批id
const getNodeList = ()=>{
getApproveNodeList(24).then(res=>{
console.log("差旅报销审批-所有流程",res)
getApproveNodeList(23).then(res=>{
console.log("项目费用报销-所有流程",res.data)
allList.value = res.data.nodeList
list.value = res.data.nodeList.map(item=>{
return item.roleName
......@@ -282,27 +252,27 @@ const getNodeList = ()=>{
//获取当前用户角色信息
const getRoleInfo = ()=>{
getRoleId().then(res=>{
console.log("角色信息",res)
console.log("项目费用报销-角色信息",res.data)
currentUserRoleInfoList.value = res.data
})
}
// 出差申请 列表
// 列表
const ReimbursementRequestList = reactive([]);
const getList=()=> {
loading.value = true;
listTripReimburse(queryParams).then(res => {
total.value = res.total;
Object.assign(tripReimburseList, res.rows);
loading.value = false;
for(let i in tripReimburseList){
tripReimburseList[i].currentStatus = approvalStatusChange(tripReimburseList[i].status,tripReimburseList[i].currentAuditRoleId)
listTripReimburse(queryParams).then(response => {
console.log("差旅报销-列表",response.rows)
total.value = response.total
Object.assign(ReimbursementRequestList, response.rows);
for(let i in ReimbursementRequestList){
console.log(ReimbursementRequestList[i])
ReimbursementRequestList[i].currentStatus = approvalStatusChange(ReimbursementRequestList[i].status,ReimbursementRequestList[i].currentAuditRoleId)
}
console.log("差旅报销审批-列表",tripReimburseList)
getTopApproveInfo()
});
}
//表格多选
const handleSelectionChange = (val) => {
passObjList.length = 0
......@@ -312,7 +282,7 @@ const handleSelectionChange = (val) => {
let index = allList.value.findIndex(item=>item.nodeId === currentAuditRoleId)
let obj = {
//差旅报销id
//项目费用id
travelOnBusinessId:item.id,
//下一个节点nodeId
nextNodeId:null,
......@@ -359,7 +329,7 @@ const approvalStatusChange = (status,currentNodeId)=>{
//获取列表第一个顶部信息
const getTopApproveInfo = ()=>{
let item2 = tripReimburseList[0]
let item2 = ReimbursementRequestList[0]
changProjectNumber.value = item2.projectNumber
let i = allList.value.findIndex((item)=>item.nodeId === item2.currentAuditRoleId)
if(i === -1) stepActive.value = 1
......@@ -410,7 +380,7 @@ const passProjectCost = (row)=>{
let index = allList.value.findIndex(item=>item.nodeId === currentAuditRoleId)
let obj = {
// 差旅报销id
//项目费用id
travelOnBusinessId:row.id,
//下一个节点nodeId
nextNodeId:null,
......@@ -491,16 +461,6 @@ const cancelReject = ()=>{
})
}
/** 搜索按钮操作 */
function handleQuery() {
}
/** 重置按钮操作 */
function resetQuery() {
}
onMounted(async ()=>{
//获取所有审批列表
await getNodeList()
......@@ -509,7 +469,6 @@ onMounted(async ()=>{
//获取列表
await getList()
})
</script>
......
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