工具录入审核

This commit is contained in:
bb_pan 2025-11-13 19:29:21 +08:00
parent 819bdd6c25
commit 313645601c
5 changed files with 582 additions and 19 deletions

View File

@ -89,3 +89,39 @@ export const updateToolApplyApi = (data = {}) => {
data: data, data: data,
}) })
} }
// 工具录入审核-列表
export const getListReviewApi = (data = {}) => {
return request({
url: '/material-mall/toolApply/listReview',
method: 'GET',
params: data,
})
}
// 单个审核
export const updateToolApplyReviewApi = (data = {}) => {
return request({
url: '/material-mall/toolApply/updateDetail',
method: 'POST',
data: data,
})
}
// 全部审核
export const updateAllDetailApi = (data = {}) => {
return request({
url: '/material-mall/toolApply/updateAllDetail',
method: 'POST',
data: data,
})
}
// 审核-编码详情
export const getListEncodingApi = (data = {}) => {
return request({
url: '/material-mall/toolApply/listEncoding',
method: 'get',
params: data,
})
}

View File

@ -82,9 +82,8 @@
<!-- 插槽 --> <!-- 插槽 -->
<template v-slot="{ row }" v-if="column.prop == 'status'"> <template v-slot="{ row }" v-if="column.prop == 'status'">
<el-tag v-if="row.status == '0'" type="info">草稿</el-tag> <el-tag v-if="row.status == '0'" type="info">草稿</el-tag>
<el-tag v-if="row.status == '1'" type="warning">审核中</el-tag> <el-tag v-if="row.status == '1'" type="warning">审批中</el-tag>
<el-tag v-if="row.status == '2'" type="success">通过</el-tag> <el-tag v-if="row.status == '2'" type="success">已审批</el-tag>
<el-tag v-if="row.status == '3'" type="danger">驳回</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center"> <el-table-column label="操作" align="center">
@ -130,9 +129,8 @@ export default {
}, },
statusList: [ statusList: [
{ label: '草稿', value: '0' }, { label: '草稿', value: '0' },
{ label: '审核中', value: '1' }, { label: '审批中', value: '1' },
{ label: '通过', value: '2' }, { label: '已审批', value: '2' },
{ label: '驳回', value: '3' },
], ],
total: 0, // total: 0, //
// //
@ -221,19 +219,6 @@ export default {
} }
}) })
}, },
//
async getDialogList() {
try {
this.isLoading = true
const params = { ...this.dialogForm }
const res = await getInventoryLogDetailsApi(params)
this.dialogList = res.data.rows || []
this.dlgTotal = res.data.total || 0
} catch (error) {
} finally {
this.isLoading = false
}
},
}, },
} }
</script> </script>

View File

@ -0,0 +1,189 @@
<template>
<!-- 基础页面 -->
<div class="app-container">
<el-card v-show="showSearch" style="margin-bottom: 20px">
<el-form :model="queryParams" ref="queryForm" size="small" inline @submit.native.prevent>
<el-form-item label="申请人" prop="createBy">
<el-input
v-model="queryParams.createBy"
placeholder="请输入申请人"
clearable
@keyup.enter.native="handleQuery"
style="width: 240px"
/>
</el-form-item>
<!-- 日期范围 -->
<el-form-item label="申请日期">
<el-date-picker
v-model="timeRange"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
clearable
unlink-panels
value-format="yyyy-MM-dd"
format="yyyy-MM-dd"
style="width: 240px"
/>
</el-form-item>
<el-form-item label="审批状态" prop="status">
<el-select
v-model="queryParams.status"
placeholder="请选择审批状态"
clearable
filterable
style="width: 240px"
>
<el-option v-for="item in statusList" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<!-- 表单按钮 -->
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">查询</el-button>
<el-button icon="el-icon-refresh" @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
</el-card>
<el-card>
<el-table
v-loading="isLoading"
:data="tableList"
highlight-current-row
border
stripe
:max-height="650"
style="width: 100%"
>
<el-table-column
type="index"
width="55"
label="序号"
align="center"
:index="(index) => (queryParams.pageNum - 1) * queryParams.pageSize + index + 1"
/>
<el-table-column
v-for="(column, index) in tableColumns"
show-overflow-tooltip
:key="index"
:label="column.label"
:prop="column.prop"
align="center"
>
<!-- 插槽 -->
<template v-slot="{ row }" v-if="column.prop == 'status'">
<el-tag v-if="row.status == '1'" type="warning">审批中</el-tag>
<el-tag v-if="row.status == '2'" type="success">已审批</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="{ row }">
<el-button v-if="row.status == 2" size="mini" type="text" icon="el-icon-zoom-in" @click="handleView(row)"
>查看</el-button
>
<el-button v-if="row.status == 1" size="mini" type="text" @click="handleApprove(row)">审核</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-card>
</div>
</template>
<script>
import { getListReviewApi } from '@/api/toolsManage'
export default {
name: 'ApproveList',
data() {
return {
isLoading: false,
showSearch: true,
timeRange: [],
queryParams: {
pageNum: 1,
pageSize: 10,
status: null,
createBy: null,
startTime: null,
endTime: null,
},
statusList: [
{ label: '审批中', value: '1' },
{ label: '已审批', value: '2' },
],
total: 0, //
//
tableColumns: [
{ label: '录入单号', prop: 'code' },
{ label: '申请录入数量', prop: 'total' },
{ label: '申请人', prop: 'createBy' },
{ label: '申请时间', prop: 'createTime' },
{ label: '审批状态', prop: 'status' },
{ label: '已通过数量', prop: 'passed' },
{ label: '已驳回数量', prop: 'quantity' },
],
//
tableList: [],
}
},
created() {
this.getList()
},
methods: {
//
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
//
handleReset() {
this.queryParams.pageNum = 1
this.queryParams.pageSize = 10
this.queryParams.parentId = '0'
this.queryParams.level = '1'
this.timeRange = []
this.$refs.queryForm.resetFields()
this.getList()
},
//
async getList() {
console.log('列表-查询', this.queryParams)
this.isLoading = true
this.queryParams.startTime = this.timeRange && this.timeRange[0] ? this.timeRange[0] : null
this.queryParams.endTime = this.timeRange && this.timeRange[1] ? this.timeRange[1] : null
try {
const params = { ...this.queryParams }
const res = await getListReviewApi(params)
this.tableList = res.rows || []
this.total = res.total || 0
} catch (error) {
this.tableList = []
this.total = 0
} finally {
this.isLoading = false
}
},
//
handleView(row) {
this.$router.push({ path: '/toolsManage/approveToolsDetails', query: { applyId: row.id, isView: true } })
},
//
handleApprove(row) {
this.$router.push({ path: '/toolsManage/approveToolsDetails', query: { applyId: row.id } })
},
},
}
</script>
<style lang="scss" scoped></style>

View File

@ -0,0 +1,269 @@
<template>
<!-- 基础页面 -->
<div class="app-container">
<el-card v-show="showSearch" style="margin-bottom: 20px">
<el-form :model="queryParams" ref="queryForm" size="small" inline @submit.native.prevent>
<el-form-item label="工具名称" prop="parentTypeName">
<el-input
v-model="queryParams.parentTypeName"
placeholder="请输入工具名称"
clearable
@keyup.enter.native="handleQuery"
style="width: 240px"
/>
</el-form-item>
<el-form-item label="规格型号" prop="typeName">
<el-input
v-model="queryParams.typeName"
placeholder="请输入规格型号"
clearable
@keyup.enter.native="handleQuery"
style="width: 240px"
/>
</el-form-item>
<el-form-item label="管理模式" prop="manageType">
<el-select
v-model="queryParams.manageType"
placeholder="请选择管理模式"
clearable
filterable
style="width: 240px"
>
<el-option v-for="item in typeList" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<!-- 表单按钮 -->
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">查询</el-button>
<el-button icon="el-icon-refresh" @click="handleReset">重置</el-button>
</el-form-item>
</el-form>
</el-card>
<el-card>
<el-row :gutter="10" class="mb8" justify="end">
<el-col :span="4">
<span style="font-size: 20px; font-weight: 800">工具录入审核列表</span>
</el-col>
<el-col v-if="!routerParams.isView && showAll" :span="20" style="display: flex; justify-content: flex-end">
<el-button type="primary" @click="handleAllApprove(2)">全部通过</el-button>
<el-button type="primary" @click="handleAllApprove(3)">全部驳回</el-button>
</el-col>
</el-row>
<el-table
v-loading="isLoading"
:data="tableList"
highlight-current-row
border
stripe
:max-height="650"
style="width: 100%"
>
<el-table-column
type="index"
width="55"
label="序号"
align="center"
:index="(index) => (queryParams.pageNum - 1) * queryParams.pageSize + index + 1"
/>
<el-table-column
v-for="(column, index) in tableColumns"
show-overflow-tooltip
:key="index"
:label="column.label"
:prop="column.prop"
align="center"
>
<!-- 插槽 -->
<template v-slot="{ row }" v-if="column.prop == 'status'">
<el-tag v-if="row.status == '1'" type="warning">审核中</el-tag>
<el-tag v-if="row.status == '2'" type="success">通过</el-tag>
<el-tag v-if="row.status == '3'" type="danger">驳回</el-tag>
</template>
<template v-slot="{ row }" v-else-if="column.prop == 'manageType'">
<span>{{ row.manageType == 0 ? '数量管理' : '编码管理' }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" v-if="!routerParams.isView">
<template slot-scope="{ row }">
<el-button v-if="row.manageType == 1" size="mini" type="text" @click="handleDialog(row)">查看</el-button>
<el-button v-if="row.status == 1" size="mini" type="text" @click="handleApprove(row, 2)">通过</el-button>
<el-button v-if="row.status == 1" size="mini" type="text" @click="handleApprove(row, 3)" style="color: red"
>驳回</el-button
>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</el-card>
<Details ref="detailsRef" />
</div>
</template>
<script>
import { getListByApplyIdApi, updateAllDetailApi, updateToolApplyReviewApi } from '@/api/toolsManage'
import Details from './components/Details'
export default {
name: 'ApproveToolsDetails',
components: { Details },
data() {
return {
routerParams: {},
isLoading: false,
showSearch: true,
timeRange: [],
queryParams: {
pageNum: 1,
pageSize: 10,
parentTypeName: null,
typeName: null,
manageType: null,
applyId: null,
},
typeList: [
{ label: '数量管理', value: '0' },
{ label: '编码管理', value: '1' },
],
total: 0, //
//
tableColumns: [
{ label: '工具专业', prop: 'fourthParentName' },
{ label: '施工类型', prop: 'greatGrandparentName' },
{ label: '工具类型', prop: 'grandparentTypeName' },
{ label: '工具名称', prop: 'parentTypeName' },
{ label: '规格型号', prop: 'typeName' },
{ label: '管理模式', prop: 'manageType' },
{ label: '申请数量', prop: 'applyNum' },
{ label: '审批状态', prop: 'status' },
],
//
tableList: [],
}
},
computed: {
showAll() {
return this.tableList.length > 0 && this.tableList.some((item) => item.status == 1)
},
},
created() {
this.routerParams = this.$route.query
let title = '工具审核'
if (this.routerParams.isView) {
title = '审核详情'
}
this.queryParams.applyId = this.routerParams.applyId || ''
const obj = Object.assign({}, this.$route, { title })
this.$tab.updatePage(obj)
this.getList()
},
methods: {
//
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
//
handleReset() {
this.queryParams.pageNum = 1
this.queryParams.pageSize = 10
this.queryParams.parentId = '0'
this.queryParams.level = '1'
this.$refs.queryForm.resetFields()
this.getList()
},
//
async getList(emit = {}) {
console.log('🚀 ~ emit:', emit)
if (emit.applyId) {
this.queryParams.applyId = emit.applyId
// route
this.$route.query.applyId = this.queryParams.applyId
}
console.log('列表-查询', this.queryParams)
this.isLoading = true
try {
const params = { ...this.queryParams }
const res = await getListByApplyIdApi(params)
this.tableList = res.rows || []
this.total = res.total || 0
} catch (error) {
this.tableList = []
this.total = 0
} finally {
this.isLoading = false
}
},
handleDialog(row) {
const params = { applyId: this.queryParams.applyId, typeId: row.typeId }
this.$refs.detailsRef.openDialog(params)
},
// /
handleAllApprove(type) {
const tip = type == 2 ? '是否确定全部通过?' : '是否确定全部驳回?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(async () => {
this.isLoading = true
try {
await updateAllDetailApi({ applyId: this.queryParams.applyId, status: type })
//
this.$message({
type: 'success',
message: '操作成功!',
})
this.$tab.closeOpenPage({ path: '/toolsManage/approveList' })
} catch (error) {
console.log('🚀 ~ error:', error)
} finally {
this.isLoading = false
}
})
},
//
handleApprove(row, type) {
console.log('🚀 ~ row:', row)
const tip = type == 2 ? '是否确定通过?' : '是否确定驳回?'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(async () => {
this.isLoading = true
try {
await updateToolApplyReviewApi({ applyId: this.queryParams.applyId, status: type, typeId: row.typeId })
//
this.$message({
type: 'success',
message: '操作成功!',
})
if (showAll) {
this.getList()
} else {
this.$tab.closeOpenPage({ path: '/toolsManage/approveList' })
}
} catch (error) {
console.log('🚀 ~ error:', error)
} finally {
this.isLoading = false
}
})
},
},
}
</script>
<style lang="scss" scoped></style>

View File

@ -0,0 +1,84 @@
<template>
<div>
<el-dialog :title="dialogTitle" :visible.sync="dialogVisible" width="80%" :close-on-click-modal="false">
<el-card v-loading="isLoading">
<el-table :data="dialogList" border stripe highlight-current-row :max-height="500" style="width: 100%">
<el-table-column type="index" width="55" label="序号" align="center" />
<el-table-column
v-for="(column, index) in dialogColumns"
:width="column.width"
:show-overflow-tooltip="!column.unShowTooltip"
:key="index"
:label="column.label"
:prop="column.prop"
align="center"
>
</el-table-column>
</el-table>
<!-- 分页 -->
<pagination
v-show="total > 0"
:total="total"
:page.sync="dialogForm.pageNum"
:limit.sync="dialogForm.pageSize"
@pagination="getList"
/>
</el-card>
</el-dialog>
</div>
</template>
<script>
import { getListEncodingApi } from '@/api/toolsManage'
export default {
data() {
return {
isLoading: false,
dialogTitle: '编码详情',
dialogVisible: false,
dialogForm: {
pageNum: 1,
pageSize: 10,
applyId: null,
typeId: null,
},
total: 0,
dialogColumns: [
{ label: '工具专业', prop: 'fourthParentName' },
{ label: '施工类型', prop: 'greatGrandparentName' },
{ label: '工具类型', prop: 'grandparentTypeName' },
{ label: '工具名称', prop: 'parentTypeName' },
{ label: '规格型号', prop: 'typeName' },
{ label: '计量单位', prop: 'unitName' },
{ label: '生产厂家', prop: 'supplierName', width: 180 },
{ label: '出厂日期', prop: 'productionDate', width: 150 },
{ label: '资产原值', prop: 'toolPrice', width: 150 },
{ label: '原始编码', prop: 'identifyCode', width: 150 },
],
dialogList: [],
}
},
methods: {
openDialog(opts) {
this.dialogForm.applyId = opts.applyId
this.dialogForm.typeId = opts.typeId
this.dialogList = []
this.dialogVisible = true
this.getList()
},
async getList() {
try {
const res = await getListEncodingApi({ ...this.dialogForm })
this.dialogList = res.rows
this.total = res.total
} catch (error) {
console.log('🚀 ~ error:', error)
}
},
},
}
</script>
<style lang="scss" scoped></style>