入库管理
This commit is contained in:
parent
8501d37208
commit
dc4071eea6
|
|
@ -205,4 +205,16 @@ aside {
|
|||
|
||||
.my-table {
|
||||
min-height: 546px;
|
||||
}
|
||||
|
||||
.search-form {
|
||||
display: flex;
|
||||
flex-wrap: wrap; /* 空间不够时才换行 */
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/* 关键:让最后一个自动靠右 */
|
||||
.search-form .form-right {
|
||||
margin-left: auto;
|
||||
white-space: nowrap; /* 按钮不换行 */
|
||||
}
|
||||
|
|
@ -0,0 +1,234 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-card style="margin-bottom: 20px">
|
||||
<el-form
|
||||
v-show="showSearch"
|
||||
:model="queryParams"
|
||||
ref="queryForm"
|
||||
size="small"
|
||||
class="search-form"
|
||||
label-width="80px"
|
||||
@submit.native.prevent
|
||||
>
|
||||
<el-form-item label="申请人:" prop="applyName">
|
||||
<el-input
|
||||
v-model="queryParams.applyName"
|
||||
placeholder="请输入内容"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
style="width: 240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 日期范围 -->
|
||||
<el-form-item label="申请时间:" prop="timeRange">
|
||||
<el-date-picker
|
||||
v-model="queryParams.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 style="width: 240px">
|
||||
<el-option v-for="item in statusList" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 表单按钮 -->
|
||||
<el-form-item class="form-right">
|
||||
<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 style="margin-bottom: 20px">
|
||||
<el-row :gutter="10" class="mb8" style="display: flex; justify-content: flex-end">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" size="mini" @click="handleAdd">新增</el-button>
|
||||
<el-button type="primary" size="mini" @click="batchSubmit">申请提交</el-button>
|
||||
</el-col>
|
||||
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" /> -->
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
class="my-table"
|
||||
:data="tableList"
|
||||
highlight-current-row
|
||||
style="width: 100%"
|
||||
v-loading="isLoading"
|
||||
@selection-change="selectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="45" align="center" />
|
||||
<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"
|
||||
>
|
||||
</el-table-column>
|
||||
<!-- 操作 -->
|
||||
<el-table-column label="操作" align="center" width="150">
|
||||
<template slot-scope="{ row }">
|
||||
<el-button type="text" size="mini" @click="handleEdit">编辑</el-button>
|
||||
<el-button type="text" style="color: red" size="mini" @click="handleDelete">删除</el-button>
|
||||
<el-button type="text" size="mini" @click="submit">提交</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<pagination
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'EntryApply',
|
||||
data() {
|
||||
return {
|
||||
isLoading: false,
|
||||
showSearch: true,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
applyName: '', // 关键字
|
||||
startTime: '', // 开始时间
|
||||
endTime: '', // 结束时间
|
||||
timeRange: [], // 创建日期范围
|
||||
status: '',
|
||||
},
|
||||
total: 0, // 总条数
|
||||
// 表头
|
||||
tableColumns: [
|
||||
{ label: '录入单号', prop: 'code' },
|
||||
{ label: '装备数量', prop: 'equipNum' },
|
||||
{ label: '工具数量', prop: 'toolNum' },
|
||||
{ label: '申请人', prop: 'applyName' },
|
||||
{ label: '申请时间', prop: 'applyTime' },
|
||||
{ label: '审批状态', prop: 'status' },
|
||||
],
|
||||
// 表格数据
|
||||
tableList: [{ code: 1 }, { code: 1 }, { code: 1 }],
|
||||
statusList: [
|
||||
{ label: '草稿', value: '1' },
|
||||
{ label: '驳回', value: '2' },
|
||||
{ label: '审批中', value: '3' },
|
||||
],
|
||||
selectedRowKeys: [],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
// 查询
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
// 重置
|
||||
handleReset() {
|
||||
this.$refs.queryForm.resetFields()
|
||||
this.queryParams.pageNum = 1
|
||||
this.queryParams.pageSize = 10
|
||||
this.getList()
|
||||
},
|
||||
// 获取列表
|
||||
async getList() {
|
||||
console.log('列表-查询', this.queryParams)
|
||||
this.isLoading = true
|
||||
try {
|
||||
const params = {
|
||||
...this.queryParams,
|
||||
startTime: this.queryParams.timeRange ? this.queryParams.timeRange[0] : '',
|
||||
endTime: this.queryParams.timeRange ? this.queryParams.timeRange[1] : '',
|
||||
}
|
||||
delete params.timeRange
|
||||
console.log('🚀 ~ getList ~ params:', params)
|
||||
// const res = await (params)
|
||||
// console.log('🚀 ~ 获取列表 ~ res:', res)
|
||||
// this.tableList = res.data.rows || []
|
||||
// this.total = res.data.total || 0
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ 获取列表 ~ error:', error)
|
||||
this.tableList = []
|
||||
this.total = 0
|
||||
} finally {
|
||||
this.isLoading = false
|
||||
}
|
||||
},
|
||||
selectionChange(val) {
|
||||
if (!val.length) this.selectedRowKeys = []
|
||||
this.selectedRowKeys = val.map((item) => item.id)
|
||||
},
|
||||
// 新增
|
||||
handleAdd() {},
|
||||
// 编辑
|
||||
handleEdit() {},
|
||||
// 删除
|
||||
async handleDelete() {
|
||||
// 确认
|
||||
this.$modal.confirm('是否确认删除该数据项?').then(async () => {
|
||||
try {
|
||||
this.$modal.msgSuccess('删除成功')
|
||||
this.getList()
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ error:', error)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 提交
|
||||
async submit() {
|
||||
// 确认
|
||||
this.$modal.confirm('是否确认提交?').then(async () => {
|
||||
try {
|
||||
this.$modal.msgSuccess('删除成功')
|
||||
this.getList()
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ error:', error)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 批量提交
|
||||
async batchSubmit() {
|
||||
if (this.selectedRowKeys.length === 0) {
|
||||
this.$modal.msgError('请选择需要提交的数据')
|
||||
return
|
||||
}
|
||||
// 确认
|
||||
this.$modal.confirm('是否确认提交?').then(async () => {
|
||||
try {
|
||||
this.$modal.msgSuccess('删除成功')
|
||||
this.getList()
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ error:', error)
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
|
|
@ -0,0 +1,233 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-card style="margin-bottom: 20px">
|
||||
<el-form
|
||||
v-show="showSearch"
|
||||
:model="queryParams"
|
||||
ref="queryForm"
|
||||
size="small"
|
||||
class="search-form"
|
||||
label-width="80px"
|
||||
@submit.native.prevent
|
||||
>
|
||||
<el-form-item label="审批类型:" prop="type">
|
||||
<el-select v-model="queryParams.type" placeholder="请选择" clearable style="width: 240px">
|
||||
<el-option v-for="item in typeList" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="申请人:" prop="applyName">
|
||||
<el-input
|
||||
v-model="queryParams.applyName"
|
||||
placeholder="请输入内容"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
style="width: 240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 日期范围 -->
|
||||
<el-form-item label="申请时间:" prop="timeRange">
|
||||
<el-date-picker
|
||||
v-model="queryParams.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 class="form-right">
|
||||
<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 style="margin-bottom: 20px">
|
||||
<el-row :gutter="10" class="mb8" style="display: flex; justify-content: flex-end">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" size="mini" @click="batchSubmit(1)">一键审核</el-button>
|
||||
<el-button type="danger" size="mini" @click="batchSubmit(2)">一键驳回</el-button>
|
||||
</el-col>
|
||||
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" /> -->
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
class="my-table"
|
||||
:data="tableList"
|
||||
highlight-current-row
|
||||
style="width: 100%"
|
||||
v-loading="isLoading"
|
||||
@selection-change="selectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="45" align="center" />
|
||||
<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"
|
||||
>
|
||||
</el-table-column>
|
||||
<!-- 操作 -->
|
||||
<el-table-column label="操作" align="center" width="150">
|
||||
<template slot-scope="{ row }">
|
||||
<el-button type="text" size="mini" @click="submit">审核</el-button>
|
||||
<el-button type="text" style="color: red" size="mini" @click="handleReject">驳回</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<pagination
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'InventoryAudit',
|
||||
data() {
|
||||
return {
|
||||
isLoading: false,
|
||||
showSearch: true,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
applyName: '', // 关键字
|
||||
startTime: '', // 开始时间
|
||||
endTime: '', // 结束时间
|
||||
timeRange: [], // 创建日期范围
|
||||
type: '',
|
||||
},
|
||||
total: 0, // 总条数
|
||||
// 表头
|
||||
tableColumns: [
|
||||
{ label: '录入单号', prop: 'code' },
|
||||
{ label: '装备数量', prop: 'equipNum' },
|
||||
{ label: '工具数量', prop: 'toolNum' },
|
||||
{ label: '申请人', prop: 'applyName' },
|
||||
{ label: '申请时间', prop: 'applyTime' },
|
||||
{ label: '审批状态', prop: 'status' },
|
||||
{ label: '专业', prop: 'major' },
|
||||
{ label: '装备/工具名称', prop: 'name' },
|
||||
],
|
||||
// 表格数据
|
||||
tableList: [{ code: 1 }, { code: 1 }, { code: 1 }],
|
||||
typeList: [
|
||||
{ label: '设备', value: '1' },
|
||||
{ label: '全部工具', value: '2' },
|
||||
{ label: '编码工具', value: '3' },
|
||||
{ label: '数量工具', value: '4' },
|
||||
],
|
||||
selectedRowKeys: [],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
// 查询
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
// 重置
|
||||
handleReset() {
|
||||
this.$refs.queryForm.resetFields()
|
||||
this.queryParams.pageNum = 1
|
||||
this.queryParams.pageSize = 10
|
||||
this.getList()
|
||||
},
|
||||
// 获取列表
|
||||
async getList() {
|
||||
console.log('列表-查询', this.queryParams)
|
||||
this.isLoading = true
|
||||
try {
|
||||
const params = {
|
||||
...this.queryParams,
|
||||
startTime: this.queryParams.timeRange ? this.queryParams.timeRange[0] : '',
|
||||
endTime: this.queryParams.timeRange ? this.queryParams.timeRange[1] : '',
|
||||
}
|
||||
delete params.timeRange
|
||||
console.log('🚀 ~ getList ~ params:', params)
|
||||
// const res = await (params)
|
||||
// console.log('🚀 ~ 获取列表 ~ res:', res)
|
||||
// this.tableList = res.data.rows || []
|
||||
// this.total = res.data.total || 0
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ 获取列表 ~ error:', error)
|
||||
this.tableList = []
|
||||
this.total = 0
|
||||
} finally {
|
||||
this.isLoading = false
|
||||
}
|
||||
},
|
||||
selectionChange(val) {
|
||||
if (!val.length) this.selectedRowKeys = []
|
||||
this.selectedRowKeys = val.map((item) => item.id)
|
||||
},
|
||||
// 驳回
|
||||
async handleReject() {
|
||||
// 确认
|
||||
this.$modal.confirm('是否确认驳回该数据项?').then(async () => {
|
||||
try {
|
||||
this.$modal.msgSuccess('操作成功')
|
||||
this.getList()
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ error:', error)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 提交
|
||||
async submit() {
|
||||
// 确认
|
||||
this.$modal.confirm('是否确认审批?').then(async () => {
|
||||
try {
|
||||
this.$modal.msgSuccess('操作成功')
|
||||
this.getList()
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ error:', error)
|
||||
}
|
||||
})
|
||||
},
|
||||
// 批量提交
|
||||
batchSubmit(type) {
|
||||
// type: 1: 审核 2: 驳回
|
||||
if (this.selectedRowKeys.length === 0) {
|
||||
this.$modal.msgError('请选择需要提交的数据')
|
||||
return
|
||||
}
|
||||
// 确认
|
||||
this.$modal.confirm(`是否确认${type == 1 ? '审核' : '驳回'}?`).then(async () => {
|
||||
try {
|
||||
this.$modal.msgSuccess('操作成功')
|
||||
this.getList()
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ error:', error)
|
||||
}
|
||||
})
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
|
|
@ -0,0 +1,274 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-card style="margin-bottom: 20px">
|
||||
<el-form
|
||||
v-show="showSearch"
|
||||
:model="queryParams"
|
||||
ref="queryForm"
|
||||
size="small"
|
||||
class="search-form"
|
||||
label-width="80px"
|
||||
@submit.native.prevent
|
||||
>
|
||||
<el-form-item label="入库设备:" prop="type">
|
||||
<el-select v-model="queryParams.type" placeholder="请选择" clearable style="width: 240px">
|
||||
<el-option v-for="item in typeList" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="申请人:" prop="applyName">
|
||||
<el-input
|
||||
v-model="queryParams.applyName"
|
||||
placeholder="请输入内容"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
style="width: 240px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- 日期范围 -->
|
||||
<el-form-item label="申请时间:" prop="timeRange">
|
||||
<el-date-picker
|
||||
v-model="queryParams.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 style="width: 240px">
|
||||
<el-option v-for="item in statusList" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<!-- 表单按钮 -->
|
||||
<el-form-item class="form-right">
|
||||
<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 style="margin-bottom: 20px">
|
||||
<el-row :gutter="10" class="mb8" style="display: flex; justify-content: flex-end">
|
||||
<!-- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" /> -->
|
||||
</el-row>
|
||||
|
||||
<el-table class="my-table" :data="tableList" highlight-current-row style="width: 100%" v-loading="isLoading">
|
||||
<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"
|
||||
>
|
||||
</el-table-column>
|
||||
<!-- 操作 -->
|
||||
<el-table-column label="操作" align="center" width="150">
|
||||
<template slot-scope="{ row }">
|
||||
<el-button type="text" size="mini" @click="handleDetails">详情记录</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!-- 分页 -->
|
||||
<pagination
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</el-card>
|
||||
|
||||
<!-- 入库记录单 -->
|
||||
<el-dialog title="入库记录单" :visible.sync="recordVisible" width="65%" append-to-body>
|
||||
<el-row style="display: flex; justify-content: flex-end; gap: 8px">
|
||||
<el-button size="mini" type="primary" @click="handleDownloadPDF">下载</el-button>
|
||||
<el-button size="mini" type="primary" @click="onHandlePrint">打印</el-button>
|
||||
<el-button size="mini" type="primary" @click="recordVisible = false">关闭</el-button>
|
||||
</el-row>
|
||||
|
||||
<vue-easy-print v-if="recordVisible" ref="recordPrintRef" id="print-content" tableShow style="width: 100%">
|
||||
<h2 style="text-align: center; font-size: 28px">入库记录单</h2>
|
||||
<el-row class="record-row">
|
||||
<el-col :span="16">
|
||||
<div> 操作人:{{ recordParams.createUser }}</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div> 操作时间: {{ recordParams.createTime }}</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div class="dialog-table">
|
||||
<table
|
||||
border="1"
|
||||
cellspacing="0"
|
||||
cellpadding="6"
|
||||
style="width: 100%; border-collapse: collapse; text-align: center"
|
||||
>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 55px">序号</th>
|
||||
<th>详情设备</th>
|
||||
<th>类目</th>
|
||||
<th>规格型号</th>
|
||||
<th>设备编码</th>
|
||||
<th>设备分类</th>
|
||||
<th>使用到期时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="(item, index) in recordData" :key="index">
|
||||
<td>{{ index + 1 }}</td>
|
||||
<td> {{ item.type === '2' ? '工具' : item.type === '1' ? '装备' : '未知类型' }}</td>
|
||||
<td>{{ item.devName }}</td>
|
||||
<td>{{ item.devModel }}</td>
|
||||
<td>{{ item.devCode }}</td>
|
||||
<td>{{ item.devNum }}</td>
|
||||
<td>
|
||||
{{ item.useStartTime ? item.useStartTime : '-' }}
|
||||
至
|
||||
{{ item.useEndTime ? item.useEndTime : '-' }}
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</vue-easy-print>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import vueEasyPrint from 'vue-easy-print'
|
||||
import { downloadPDF } from '@/utils/bonus'
|
||||
|
||||
export default {
|
||||
name: 'StorageRecord',
|
||||
components: { vueEasyPrint },
|
||||
data() {
|
||||
return {
|
||||
isLoading: false,
|
||||
showSearch: true,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
applyName: '', // 关键字
|
||||
startTime: '', // 开始时间
|
||||
endTime: '', // 结束时间
|
||||
timeRange: [], // 创建日期范围
|
||||
status: '',
|
||||
},
|
||||
total: 0, // 总条数
|
||||
// 表头
|
||||
tableColumns: [
|
||||
{ label: '操作人', prop: 'applyName' },
|
||||
{ label: '操作时间', prop: 'createTime' },
|
||||
{ label: '申请时间', prop: 'applyTime' },
|
||||
{ label: '录入单号', prop: 'code' },
|
||||
{ label: '已通过数量', prop: 'passNum' },
|
||||
{ label: '已驳回数量', prop: 'rejectNum' },
|
||||
],
|
||||
// 表格数据
|
||||
tableList: [{ code: 1 }, { code: 1 }, { code: 1 }],
|
||||
statusList: [
|
||||
{ label: '草稿', value: '1' },
|
||||
{ label: '驳回', value: '2' },
|
||||
{ label: '审批中', value: '3' },
|
||||
],
|
||||
typeList: [
|
||||
{ label: '设备', value: '1' },
|
||||
{ label: '全部工具', value: '2' },
|
||||
{ label: '编码工具', value: '3' },
|
||||
{ label: '数量工具', value: '4' },
|
||||
],
|
||||
selectedRowKeys: [],
|
||||
recordVisible: false,
|
||||
recordParams: {
|
||||
createUser: '',
|
||||
createTime: '',
|
||||
},
|
||||
recordData: [],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
// 查询
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
// 重置
|
||||
handleReset() {
|
||||
this.$refs.queryForm.resetFields()
|
||||
this.queryParams.pageNum = 1
|
||||
this.queryParams.pageSize = 10
|
||||
this.getList()
|
||||
},
|
||||
// 获取列表
|
||||
async getList() {
|
||||
console.log('列表-查询', this.queryParams)
|
||||
this.isLoading = true
|
||||
try {
|
||||
const params = {
|
||||
...this.queryParams,
|
||||
startTime: this.queryParams.timeRange ? this.queryParams.timeRange[0] : '',
|
||||
endTime: this.queryParams.timeRange ? this.queryParams.timeRange[1] : '',
|
||||
}
|
||||
delete params.timeRange
|
||||
console.log('🚀 ~ getList ~ params:', params)
|
||||
// const res = await (params)
|
||||
// console.log('🚀 ~ 获取列表 ~ res:', res)
|
||||
// this.tableList = res.data.rows || []
|
||||
// this.total = res.data.total || 0
|
||||
} catch (error) {
|
||||
console.log('🚀 ~ 获取列表 ~ error:', error)
|
||||
this.tableList = []
|
||||
this.total = 0
|
||||
} finally {
|
||||
this.isLoading = false
|
||||
}
|
||||
},
|
||||
// 详情
|
||||
handleDetails() {
|
||||
this.recordVisible = true
|
||||
},
|
||||
// 下载PDF
|
||||
handleDownloadPDF() {
|
||||
downloadPDF({
|
||||
id: 'print-content',
|
||||
fileName: '入库记录单',
|
||||
modal: this.$modal,
|
||||
message: this.$message,
|
||||
})
|
||||
},
|
||||
// 打印
|
||||
onHandlePrint() {
|
||||
this.$refs.recordPrintRef.print()
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.record-row {
|
||||
margin-bottom: 10px;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
line-height: 40px;
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in New Issue