领用申请审核功能优化完善

This commit is contained in:
BianLzhaoMin 2025-03-04 18:13:36 +08:00
parent a48d92859a
commit c94d536c4f
2 changed files with 52 additions and 88 deletions

View File

@ -4,8 +4,8 @@
<el-col :span="18">
<div class="left-container">
<div class="pages-title">领用申请详情</div>
<TitleTip :title="`基本信息`" />
<TitleTip :title="`基本信息`" />
<el-form size="small" style="padding: 20px" disabled label-width="120px" :model="detailsInfo">
<el-row>
<el-col :span="8">
@ -50,8 +50,8 @@
</el-col>
</el-row>
</el-form>
<TitleTip :title="`明细信息`" />
<TitleTip :title="`明细信息`" />
<el-table style="margin-top: 20px" :data="detailsList">
<el-table-column label="序号" align="center" width="80" type="index" />
<el-table-column prop="maTypeName" label="类型名称" align="center" show-overflow-tooltip />
@ -60,13 +60,9 @@
<el-table-column prop="preNum" label="预领数量" align="center" show-overflow-tooltip />
<el-table-column prop="remark" label="备注" align="center" show-overflow-tooltip />
</el-table>
<TitleTip :title="`附件信息`" />
<div class="file-box">
<!-- <div v-for="i in 2" :key="i">附件{{ i }}</div> -->
暂无附件
</div>
<div class="file-box">暂无附件</div>
</div>
</el-col>
<el-col :span="6">
@ -82,7 +78,6 @@
<el-step v-for="step in auditingList" :key="step.id" :title="step.nodeName">
<template slot="description">
<div class="custom-description">
<!-- {{ step.description }} -->
审核结果:
<el-tag size="mini" type="primary" v-if="step.isAccept === 0">待审批</el-tag>
<el-tag size="mini" type="success" v-if="step.isAccept === 1">已通过</el-tag>
@ -106,8 +101,8 @@
<div class="auditing-container" v-if="pagesType === 1">
<el-input
type="textarea"
v-model="auditingParams.remark"
placeholder="请输入审核意见"
v-model="auditingParams.remark"
:autosize="{ minRows: 2, maxRows: 6 }"
/>
@ -124,44 +119,39 @@
<script>
import TitleTip from './components/title-tip.vue'
import { submitAuditingApi, getAuditingDetailsApi } from '@/api/receive-apply/index.js'
import { getLeaseTaskDetail } from '@/api/business/index'
import { submitAuditingApi, getAuditingDetailsApi } from '@/api/receive-apply/index.js'
export default {
components: {
TitleTip
},
data() {
return {
opinion: '',
detailsInfo: {},
content: `<span style="color:red">测试996</span>`,
steps: [
{ title: '步骤 1', description: '描述信息 1', color: 'red' },
{ title: '步骤 2', description: '描述信息 2', color: 'blue' },
{ title: '步骤 3', description: '描述信息 3', color: 'green' }
],
active: 1,
userId: '',
pagesType: 1,
currentNodeId: '',
detailsInfo: {},
detailsList: [],
auditingList: [],
userId: '',
auditingParams: {
recordId: '',
nodeId: '', // id
nextNodeId: '', // ID
isAccept: '', // 1. 2.
remark: '', //
typeId: '', // typeId
taskId: '' // taskId
},
pagesType: 1
taskId: '', // taskId
isAccept: '', // 1. 2.
recordId: '',
nextNodeId: '' // ID
}
}
},
created() {
//
if (this.$route.query) {
const { id, taskId, type } = this.$route.query
const { id, taskId, type, nodeId } = this.$route.query
this.auditingParams.taskId = taskId
this.pagesType = type
this.currentNodeId = nodeId
this.getLeaseTaskDetailFun(id, taskId)
}
@ -171,8 +161,9 @@ export default {
//
async onHandleAuditing(type) {
//
const currentAuditing = this.auditingList.filter(e => e.configValues.includes(this.userId)) //
const currentIndex = this.auditingList.findIndex(e => e.configValues.includes(this.userId)) //
const currentAuditing = this.auditingList.filter(e => e.nodeId === this.currentNodeId) //
const currentIndex = this.auditingList.findIndex(e => e.nodeId === this.currentNodeId) //
const { recordId, id, typeId, isAccept } = currentAuditing[0]
@ -191,7 +182,6 @@ export default {
}
const res = await submitAuditingApi(this.auditingParams)
console.log(res, '提交结果')
if (res.code === 200) {
this.$modal.msgSuccess('审核成功')
@ -200,8 +190,6 @@ export default {
this.$tab.closeOpenPage(obj)
}, 500)
}
console.log(this.auditingParams, ' this.auditingParams组装好的参数')
},
//
@ -213,7 +201,6 @@ export default {
const { rows: result } = await getAuditingDetailsApi({ taskId })
this.auditingList = result
console.log('result审核记录详情', result)
}
}
}

View File

@ -4,31 +4,30 @@
<el-form v-show="showSearch" :model="queryParams" ref="queryForm" size="small" inline>
<el-form-item label="申请日期" prop="timeRange">
<el-date-picker
v-model="queryParams.timeRange"
clearable
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
clearable
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
end-placeholder="结束日期"
start-placeholder="开始日期"
v-model="queryParams.timeRange"
/>
</el-form-item>
<el-form-item label="关键字" prop="keyWord">
<el-input
v-model="queryParams.keyWord"
placeholder="请输入关键字"
clearable
placeholder="请输入关键字"
v-model="queryParams.keyWord"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="审核状态" prop="taskStatus">
<el-select v-model="queryParams.taskStatus" placeholder="请选择审核状态" clearable>
<el-option
v-for="item in statusOptions"
:key="item.value"
:label="item.label"
:value="item.value"
v-for="item in statusOptions"
/>
</el-select>
</el-form-item>
@ -40,35 +39,23 @@
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">领料申请</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">
导出数据
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> -->
</el-row>
<el-table :data="tableList" fit highlight-current-row style="width: 100%">
<!-- 多选 -->
<el-table-column type="selection" width="55" align="center" @selection-change="selectionChange" />
<el-table-column
type="index"
width="55"
type="index"
label="序号"
align="center"
:index="indexContinuation(queryParams.pageNum, queryParams.pageSize)"
/>
<el-table-column
v-for="(column, index) in tableColumns"
show-overflow-tooltip
:key="column.prop"
:label="column.label"
:prop="column.prop"
align="center"
:key="column.prop"
:prop="column.prop"
:label="column.label"
show-overflow-tooltip
v-for="column in tableColumns"
>
<!-- 插槽 -->
<template v-slot="scope" v-if="column.prop == 'taskStatus'">
@ -81,19 +68,19 @@
<el-table-column label="操作" align="center" width="180">
<template slot-scope="scope">
<el-button
v-if="scope.row.taskStatus != 2"
type="text"
size="mini"
icon="el-icon-edit"
v-if="auditingShow(scope.row)"
@click="handleAuditing(scope.row, 1)"
>
审核
</el-button>
<el-button
v-if="scope.row.taskStatus == 2"
type="text"
size="mini"
icon="el-icon-search"
v-if="scope.row.taskStatus == 2"
@click="handleAuditing(scope.row, 2)"
>
查看
@ -104,23 +91,24 @@
<!-- 分页 -->
<pagination
v-show="total > 0"
:total="total"
v-show="total > 0"
@pagination="getList"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { getLeaseTaskList, deleteLeaseTask } from '@/api/business/index'
import { getReceiveApplyApi } from '@/api/receive-apply/index.js'
import { getLeaseTaskList, deleteLeaseTask } from '@/api/business/index'
export default {
data() {
return {
showSearch: true,
userId: '',
queryParams: {
pageNum: 1,
pageSize: 10,
@ -143,7 +131,7 @@ export default {
{ label: '领用工程', prop: 'leaseProject' },
{ label: '领料物资类型', prop: 'maTypeNames' },
{ label: '协议号', prop: 'agreementCode' },
{ label: '采购申请单号', prop: 'applyCode' },
{ label: '业务单号', prop: 'code' },
{ label: '领料人', prop: 'leasePerson' },
{ label: '领料人电话', prop: 'phone' },
{ label: '状态', prop: 'taskStatus' }
@ -153,6 +141,7 @@ export default {
}
},
created() {
this.userId = sessionStorage.getItem('userId')
this.getList()
},
methods: {
@ -169,7 +158,6 @@ export default {
},
//
async getList() {
console.log('列表-查询', this.queryParams)
try {
const params = {
...this.queryParams,
@ -177,22 +165,9 @@ export default {
endTime: this.queryParams.timeRange[1] || ''
}
const res = await getReceiveApplyApi(params)
console.log('🚀 ~ 获取列表 ~ res:', res)
this.tableList = res.data.rows
// this.tableList = [
// {
// createBy: ''
// },
// {
// createBy: ''
// },
// {
// createBy: ''
// }
// ]
this.total = res.data.total || 0
} catch (error) {
console.log('🚀 ~ 获取列表 ~ error:', error)
this.tableList = []
this.total = 0
}
@ -207,20 +182,13 @@ export default {
},
//
handleAuditing(row, type) {
// console.log('', row)
// let params = {}
// if (type === 1) {
// params = { type: 'detail', id: row.id }
// } else {
// params = { type: 'edit', id: row.id }
// }
// this.$router.push({ path: '/business/businessHandling/index', query: params })
this.$router.push({
name: 'receive-apply-details',
query: {
id: row.id,
taskId: row.taskId,
type
type,
nodeId: row.nodeId
}
}) //
},
@ -252,6 +220,15 @@ export default {
} catch (error) {
console.log('导出数据失败', error)
}
},
//
auditingShow(row) {
console.log('row.configValues', row.configValue)
if (row.configValue) {
return row.status != 1 && row.configValue.includes(this.userId)
}
}
}
}