新增借阅
parent
da80ea880c
commit
23ebe0eac2
@ -0,0 +1,54 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 创建档案借阅申请
|
||||
export function createBorrowApply(data) {
|
||||
return request({
|
||||
url: '/archives/borrow-apply/create',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 更新档案借阅申请
|
||||
export function updateBorrowApply(data) {
|
||||
return request({
|
||||
url: '/archives/borrow-apply/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除档案借阅申请
|
||||
export function deleteBorrowApply(id) {
|
||||
return request({
|
||||
url: '/archives/borrow-apply/delete?id=' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得档案借阅申请
|
||||
export function getBorrowApply(id) {
|
||||
return request({
|
||||
url: '/archives/borrow-apply/get?id=' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获得档案借阅申请分页
|
||||
export function getBorrowApplyPage(query) {
|
||||
return request({
|
||||
url: '/archives/borrow-apply/page',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 导出档案借阅申请 Excel
|
||||
export function exportBorrowApplyExcel(query) {
|
||||
return request({
|
||||
url: '/archives/borrow-apply/export-excel',
|
||||
method: 'get',
|
||||
params: query,
|
||||
responseType: 'blob'
|
||||
})
|
||||
}
|
@ -0,0 +1,491 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryForm"
|
||||
size="small"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="108px"
|
||||
>
|
||||
<el-form-item label="借阅申请编码" prop="borrowCode">
|
||||
<el-input
|
||||
v-model="queryParams.borrowCode"
|
||||
placeholder="请输入借阅申请编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="借阅申请状态" prop="borrowState">
|
||||
<el-select
|
||||
v-model="queryParams.borrowState"
|
||||
placeholder="请选择借阅申请状态"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in borrowStateOptions"
|
||||
:key="item.id"
|
||||
:value="item.value"
|
||||
:label="item.label"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="借阅人名称" prop="userName">
|
||||
<el-input
|
||||
v-model="queryParams.userName"
|
||||
placeholder="请输入借阅人名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</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="resetQuery">重置</el-button>
|
||||
</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"
|
||||
v-hasPermi="['archives:borrowAapply:create']"
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['archives:borrowAapply:export']"
|
||||
>导出</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar
|
||||
:showSearch.sync="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<!-- 列表 -->
|
||||
<el-table v-loading="loading" :data="list">
|
||||
<el-table-column label="借阅申请编码" align="center" prop="borrowCode" />
|
||||
<el-table-column label="借阅申请状态" align="center" prop="borrowState">
|
||||
<template v-slot="scope">
|
||||
<dict-tag
|
||||
:type="DICT_TYPE.BORROW_APPLY"
|
||||
:value="scope.row.borrowState"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="借阅事由" align="center" prop="reason" />
|
||||
<el-table-column label="借阅人名称" align="center" prop="userName" />
|
||||
<el-table-column label="借阅部门名称" align="center" prop="deptName" />
|
||||
<el-table-column
|
||||
label="预计归还日期"
|
||||
align="center"
|
||||
prop="returnTime"
|
||||
width="180"
|
||||
>
|
||||
<template v-slot="scope">
|
||||
<span>{{ parseTime(scope.row.returnTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="借阅方式" align="center" prop="way">
|
||||
<template v-slot="scope">
|
||||
<dict-tag :type="DICT_TYPE.ARCHIVES_APPLY" :value="scope.row.way" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="档案介质" align="center" prop="media">
|
||||
<template v-slot="scope">
|
||||
<dict-tag :type="DICT_TYPE.ARCHIVES_MEDIA" :value="scope.row.media" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="业务实体名称" align="center" prop="company" />
|
||||
<el-table-column label="描述" align="center" prop="remark" />
|
||||
<el-table-column
|
||||
label="创建日期"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
width="180"
|
||||
>
|
||||
<template v-slot="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
class-name="small-padding fixed-width"
|
||||
>
|
||||
<template v-slot="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['archives:borrowAapply:update']"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['archives:borrowAapply:delete']"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!-- 分页组件 -->
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<el-dialog
|
||||
:title="title"
|
||||
:visible.sync="open"
|
||||
width="1000px"
|
||||
append-to-body
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="借阅申请编码" prop="borrowCode">
|
||||
<el-input
|
||||
v-model="form.borrowCode"
|
||||
placeholder="请输入借阅申请编码"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="借阅申请状态" prop="borrowState">
|
||||
<el-select
|
||||
v-model="form.borrowState"
|
||||
placeholder="请选择借阅申请状态"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in borrowStateOptions"
|
||||
:key="item.id"
|
||||
:value="item.value"
|
||||
:label="item.label"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="借阅事由" prop="reason">
|
||||
<el-input
|
||||
v-model="form.reason"
|
||||
placeholder="请输入借阅事由"
|
||||
/> </el-form-item></el-col
|
||||
></el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="借阅描述" prop="describe">
|
||||
<el-input v-model="form.describe" placeholder="请输入借阅描述" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="借阅人名称" prop="userName">
|
||||
<el-input
|
||||
v-model="form.userName"
|
||||
placeholder="请输入借阅人名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="借阅部门名称" prop="deptName">
|
||||
<el-input
|
||||
v-model="form.deptName"
|
||||
placeholder="请输入借阅部门名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="预计归还日期" prop="returnTime">
|
||||
<el-date-picker
|
||||
clearable
|
||||
v-model="form.returnTime"
|
||||
type="date"
|
||||
value-format="timestamp"
|
||||
placeholder="选择预计归还日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="借阅方式" prop="way">
|
||||
<el-select v-model="form.way" placeholder="请选择借阅方式">
|
||||
<el-option
|
||||
v-for="item in wayOptions"
|
||||
:key="item.id"
|
||||
:value="item.value"
|
||||
:label="item.label"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="档案介质" prop="media">
|
||||
<el-select v-model="form.media" placeholder="请选择档案介质">
|
||||
<el-option
|
||||
v-for="item in mediaOptions"
|
||||
:key="item.id"
|
||||
:value="item.value"
|
||||
:label="item.label"
|
||||
>
|
||||
</el-option>
|
||||
</el-select> </el-form-item
|
||||
></el-col>
|
||||
</el-row>
|
||||
<!-- <el-form-item label="业务实体名称" prop="company">
|
||||
<el-input v-model="form.company" placeholder="请输入业务实体名称" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
v-model="form.remark"
|
||||
type="textarea"
|
||||
placeholder="请输入备注"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
createBorrowApply,
|
||||
updateBorrowApply,
|
||||
deleteBorrowApply,
|
||||
getBorrowApply,
|
||||
getBorrowApplyPage,
|
||||
exportBorrowApplyExcel,
|
||||
} from "@/api/borrow/apply";
|
||||
import { listData } from "@/api/system/dict/data";
|
||||
|
||||
export default {
|
||||
name: "BorrowApply",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 导出遮罩层
|
||||
exportLoading: false,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 档案借阅申请列表
|
||||
list: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
borrowCode: null,
|
||||
borrowState: null,
|
||||
reason: null,
|
||||
describe: null,
|
||||
userId: null,
|
||||
userName: null,
|
||||
deptId: null,
|
||||
deptName: null,
|
||||
returnTime: [],
|
||||
way: null,
|
||||
media: null,
|
||||
companyId: null,
|
||||
company: null,
|
||||
remark: null,
|
||||
createTime: [],
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {},
|
||||
borrowStateOptions: [],
|
||||
wayOptions: [],
|
||||
mediaOptions: [],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.handleInitList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
// 执行查询
|
||||
getBorrowApplyPage(this.queryParams).then((response) => {
|
||||
this.list = response.data.list;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
//获取字典数据
|
||||
handleInitList() {
|
||||
// 获取借阅申请类型
|
||||
listData({
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
dictType: "borrow_apply",
|
||||
}).then((res) => {
|
||||
this.borrowStateOptions = res.data.list || [];
|
||||
});
|
||||
// 获取借阅申请类型
|
||||
listData({
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
dictType: "archives_way",
|
||||
}).then((res) => {
|
||||
this.wayOptions = res.data.list || [];
|
||||
});
|
||||
// 获取借阅申请类型
|
||||
listData({
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
dictType: "archives_media",
|
||||
}).then((res) => {
|
||||
this.mediaOptions = res.data.list || [];
|
||||
});
|
||||
},
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.form = {
|
||||
borrowId: undefined,
|
||||
borrowCode: undefined,
|
||||
borrowState: undefined,
|
||||
reason: undefined,
|
||||
describe: undefined,
|
||||
userId: undefined,
|
||||
userName: undefined,
|
||||
deptId: undefined,
|
||||
deptName: undefined,
|
||||
returnTime: undefined,
|
||||
way: undefined,
|
||||
media: undefined,
|
||||
companyId: undefined,
|
||||
company: undefined,
|
||||
remark: undefined,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加档案借阅申请";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const borrowId = row.borrowId;
|
||||
getBorrowApply(borrowId).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改档案借阅申请";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.form.borrowId != null) {
|
||||
updateBorrowApply(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
createBorrowApply(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const borrowId = row.borrowId;
|
||||
this.$modal
|
||||
.confirm('是否确认删除档案借阅申请编号为"' + borrowId + '"的数据项?')
|
||||
.then(function () {
|
||||
return deleteBorrowApply(borrowId);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = { ...this.queryParams };
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal
|
||||
.confirm("是否确认导出所有档案借阅申请数据项?")
|
||||
.then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportBorrowApplyExcel(params);
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.excel(response, "档案借阅申请.xls");
|
||||
this.exportLoading = false;
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
@ -0,0 +1,491 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!-- 搜索工作栏 -->
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryForm"
|
||||
size="small"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="108px"
|
||||
>
|
||||
<el-form-item label="借阅申请编码" prop="borrowCode">
|
||||
<el-input
|
||||
v-model="queryParams.borrowCode"
|
||||
placeholder="请输入借阅申请编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="借阅申请状态" prop="borrowState">
|
||||
<el-select
|
||||
v-model="queryParams.borrowState"
|
||||
placeholder="请选择借阅申请状态"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in borrowStateOptions"
|
||||
:key="item.id"
|
||||
:value="item.value"
|
||||
:label="item.label"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="借阅人名称" prop="userName">
|
||||
<el-input
|
||||
v-model="queryParams.userName"
|
||||
placeholder="请输入借阅人名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</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="resetQuery">重置</el-button>
|
||||
</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"
|
||||
v-hasPermi="['archives:borrowAapply:create']"
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
:loading="exportLoading"
|
||||
v-hasPermi="['archives:borrowAapply:export']"
|
||||
>导出</el-button
|
||||
>
|
||||
</el-col> -->
|
||||
<right-toolbar
|
||||
:showSearch.sync="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<!-- 列表 -->
|
||||
<el-table v-loading="loading" :data="list">
|
||||
<el-table-column label="借阅申请编码" align="center" prop="borrowCode" />
|
||||
<el-table-column label="借阅申请状态" align="center" prop="borrowState">
|
||||
<template v-slot="scope">
|
||||
<dict-tag
|
||||
:type="DICT_TYPE.BORROW_APPLY"
|
||||
:value="scope.row.borrowState"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="借阅事由" align="center" prop="reason" />
|
||||
<el-table-column label="借阅人名称" align="center" prop="userName" />
|
||||
<el-table-column label="借阅部门名称" align="center" prop="deptName" />
|
||||
<el-table-column
|
||||
label="预计归还日期"
|
||||
align="center"
|
||||
prop="returnTime"
|
||||
width="180"
|
||||
>
|
||||
<template v-slot="scope">
|
||||
<span>{{ parseTime(scope.row.returnTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="借阅方式" align="center" prop="way">
|
||||
<template v-slot="scope">
|
||||
<dict-tag :type="DICT_TYPE.ARCHIVES_APPLY" :value="scope.row.way" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="档案介质" align="center" prop="media">
|
||||
<template v-slot="scope">
|
||||
<dict-tag :type="DICT_TYPE.ARCHIVES_MEDIA" :value="scope.row.media" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="业务实体名称" align="center" prop="company" />
|
||||
<el-table-column label="描述" align="center" prop="remark" />
|
||||
<el-table-column
|
||||
label="创建日期"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
width="180"
|
||||
>
|
||||
<template v-slot="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
class-name="small-padding fixed-width"
|
||||
>
|
||||
<template v-slot="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['archives:borrowAapply:update']"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['archives:borrowAapply:delete']"
|
||||
>删除</el-button
|
||||
>
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
</el-table>
|
||||
<!-- 分页组件 -->
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNo"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 对话框(添加 / 修改) -->
|
||||
<el-dialog
|
||||
:title="title"
|
||||
:visible.sync="open"
|
||||
width="1000px"
|
||||
append-to-body
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="借阅申请编码" prop="borrowCode">
|
||||
<el-input
|
||||
v-model="form.borrowCode"
|
||||
placeholder="请输入借阅申请编码"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="借阅申请状态" prop="borrowState">
|
||||
<el-select
|
||||
v-model="form.borrowState"
|
||||
placeholder="请选择借阅申请状态"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in borrowStateOptions"
|
||||
:key="item.id"
|
||||
:value="item.value"
|
||||
:label="item.label"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="借阅事由" prop="reason">
|
||||
<el-input
|
||||
v-model="form.reason"
|
||||
placeholder="请输入借阅事由"
|
||||
/> </el-form-item></el-col
|
||||
></el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="借阅描述" prop="describe">
|
||||
<el-input v-model="form.describe" placeholder="请输入借阅描述" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="借阅人名称" prop="userName">
|
||||
<el-input
|
||||
v-model="form.userName"
|
||||
placeholder="请输入借阅人名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="借阅部门名称" prop="deptName">
|
||||
<el-input
|
||||
v-model="form.deptName"
|
||||
placeholder="请输入借阅部门名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="预计归还日期" prop="returnTime">
|
||||
<el-date-picker
|
||||
clearable
|
||||
v-model="form.returnTime"
|
||||
type="date"
|
||||
value-format="timestamp"
|
||||
placeholder="选择预计归还日期"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="借阅方式" prop="way">
|
||||
<el-select v-model="form.way" placeholder="请选择借阅方式">
|
||||
<el-option
|
||||
v-for="item in wayOptions"
|
||||
:key="item.id"
|
||||
:value="item.value"
|
||||
:label="item.label"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="档案介质" prop="media">
|
||||
<el-select v-model="form.media" placeholder="请选择档案介质">
|
||||
<el-option
|
||||
v-for="item in mediaOptions"
|
||||
:key="item.id"
|
||||
:value="item.value"
|
||||
:label="item.label"
|
||||
>
|
||||
</el-option>
|
||||
</el-select> </el-form-item
|
||||
></el-col>
|
||||
</el-row>
|
||||
<!-- <el-form-item label="业务实体名称" prop="company">
|
||||
<el-input v-model="form.company" placeholder="请输入业务实体名称" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
v-model="form.remark"
|
||||
type="textarea"
|
||||
placeholder="请输入备注"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
createBorrowApply,
|
||||
updateBorrowApply,
|
||||
deleteBorrowApply,
|
||||
getBorrowApply,
|
||||
getBorrowApplyPage,
|
||||
exportBorrowApplyExcel,
|
||||
} from "@/api/borrow/apply";
|
||||
import { listData } from "@/api/system/dict/data";
|
||||
|
||||
export default {
|
||||
name: "BorrowApply",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 导出遮罩层
|
||||
exportLoading: false,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 档案借阅申请列表
|
||||
list: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
borrowCode: null,
|
||||
borrowState: null,
|
||||
reason: null,
|
||||
describe: null,
|
||||
userId: null,
|
||||
userName: null,
|
||||
deptId: null,
|
||||
deptName: null,
|
||||
returnTime: [],
|
||||
way: null,
|
||||
media: null,
|
||||
companyId: null,
|
||||
company: null,
|
||||
remark: null,
|
||||
createTime: [],
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {},
|
||||
borrowStateOptions: [],
|
||||
wayOptions: [],
|
||||
mediaOptions: [],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.handleInitList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
// 执行查询
|
||||
getBorrowApplyPage(this.queryParams).then((response) => {
|
||||
this.list = response.data.list;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
//获取字典数据
|
||||
handleInitList() {
|
||||
// 获取借阅申请类型
|
||||
listData({
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
dictType: "borrow_apply",
|
||||
}).then((res) => {
|
||||
this.borrowStateOptions = res.data.list || [];
|
||||
});
|
||||
// 获取借阅申请类型
|
||||
listData({
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
dictType: "archives_way",
|
||||
}).then((res) => {
|
||||
this.wayOptions = res.data.list || [];
|
||||
});
|
||||
// 获取借阅申请类型
|
||||
listData({
|
||||
pageNo: 1,
|
||||
pageSize: 100,
|
||||
dictType: "archives_media",
|
||||
}).then((res) => {
|
||||
this.mediaOptions = res.data.list || [];
|
||||
});
|
||||
},
|
||||
/** 取消按钮 */
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
/** 表单重置 */
|
||||
reset() {
|
||||
this.form = {
|
||||
borrowId: undefined,
|
||||
borrowCode: undefined,
|
||||
borrowState: undefined,
|
||||
reason: undefined,
|
||||
describe: undefined,
|
||||
userId: undefined,
|
||||
userName: undefined,
|
||||
deptId: undefined,
|
||||
deptName: undefined,
|
||||
returnTime: undefined,
|
||||
way: undefined,
|
||||
media: undefined,
|
||||
companyId: undefined,
|
||||
company: undefined,
|
||||
remark: undefined,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNo = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加档案借阅申请";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const borrowId = row.borrowId;
|
||||
getBorrowApply(borrowId).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改档案借阅申请";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
// 修改的提交
|
||||
if (this.form.borrowId != null) {
|
||||
updateBorrowApply(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
return;
|
||||
}
|
||||
// 添加的提交
|
||||
createBorrowApply(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const borrowId = row.borrowId;
|
||||
this.$modal
|
||||
.confirm('是否确认删除档案借阅申请编号为"' + borrowId + '"的数据项?')
|
||||
.then(function () {
|
||||
return deleteBorrowApply(borrowId);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
// 处理查询参数
|
||||
let params = { ...this.queryParams };
|
||||
params.pageNo = undefined;
|
||||
params.pageSize = undefined;
|
||||
this.$modal
|
||||
.confirm("是否确认导出所有档案借阅申请数据项?")
|
||||
.then(() => {
|
||||
this.exportLoading = true;
|
||||
return exportBorrowApplyExcel(params);
|
||||
})
|
||||
.then((response) => {
|
||||
this.$download.excel(response, "档案借阅申请.xls");
|
||||
this.exportLoading = false;
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
Loading…
Reference in New Issue