|
|
@@ -0,0 +1,384 @@
|
|
|
+<template>
|
|
|
+ <div class="app-container">
|
|
|
+ <el-row :gutter="10">
|
|
|
+ <!--机构数据-->
|
|
|
+ <el-col :span="4" :xs="24">
|
|
|
+ <org-tree v-model="queryParams.belongOrgId" @defaultKey="getDefaultKey" @checkChange="checkChange"
|
|
|
+ @click="clickTreeNode" hangsheTree :defaultCheckSub="false"></org-tree>
|
|
|
+ </el-col>
|
|
|
+ <!--搜索栏-->
|
|
|
+ <el-col :span="20" :xs="24">
|
|
|
+ <div class="main-right-box">
|
|
|
+ <div class="main-search-box">
|
|
|
+ <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
|
|
|
+ >
|
|
|
+ <el-form-item label="登记簿类型" prop="registerBookType">
|
|
|
+ <el-select v-model="queryParams.registerBookType" placeholder="请选择登记簿类型" clearable>
|
|
|
+ <el-option
|
|
|
+ v-for="dict in dict.type.register_book_type"
|
|
|
+ :key="dict.value"
|
|
|
+ :label="dict.label"
|
|
|
+ :value="dict.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="日期" prop="date">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="queryParams.date"
|
|
|
+ type="month"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ placeholder="请选择保存日期">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ <el-row :gutter="10">
|
|
|
+
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button type="primary" @click="exportAll()" :disabled="this.registerBookList.length<=0">导出全部</el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button type="primary" @click="exportSelected()" :disabled="this.ids.length<=0">导出勾选
|
|
|
+ </el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button type="primary" @click="getDownList()">下载列表</el-button>
|
|
|
+ </el-col>
|
|
|
+<!-- <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ plain
|
|
|
+ icon="el-icon-plus"
|
|
|
+ size="mini"
|
|
|
+ @click="handleAdd"
|
|
|
+ v-hasPermi="['core:registerBook:add']"
|
|
|
+ >新增
|
|
|
+ </el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="success"
|
|
|
+ plain
|
|
|
+ icon="el-icon-edit"
|
|
|
+ size="mini"
|
|
|
+ :disabled="single"
|
|
|
+ @click="handleUpdate"
|
|
|
+ v-hasPermi="['core:registerBook:edit']"
|
|
|
+ >修改
|
|
|
+ </el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="danger"
|
|
|
+ plain
|
|
|
+ icon="el-icon-delete"
|
|
|
+ size="mini"
|
|
|
+ :disabled="multiple"
|
|
|
+ @click="handleDelete"
|
|
|
+ v-hasPermi="['core:registerBook:remove']"
|
|
|
+ >删除
|
|
|
+ </el-button>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ plain
|
|
|
+ icon="el-icon-download"
|
|
|
+ size="mini"
|
|
|
+ @click="handleExport"
|
|
|
+ v-hasPermi="['core:registerBook:export']"
|
|
|
+ >导出
|
|
|
+ </el-button>
|
|
|
+ </el-col>-->
|
|
|
+ <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+ <el-table
|
|
|
+ border
|
|
|
+ height="646"
|
|
|
+ v-loading="loading" :data="registerBookList" @selection-change="handleSelectionChange">
|
|
|
+ <el-table-column type="selection" width="55" align="center"/>
|
|
|
+ <el-table-column label="登记簿类型" align="center" prop="registerBookType">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <dict-tag :options="dict.type.register_book_type" :value="scope.row.registerBookType"/>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="所属机构" align="center" prop="orgName"/>
|
|
|
+ <el-table-column label="统计日期" align="center" prop="date" width="180">
|
|
|
+<!-- <template slot-scope="scope">
|
|
|
+ <span>{{ parseTime(scope.row.date, '{y}-{m}-{d}') }}</span>
|
|
|
+ </template>-->
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column label="文件名称" align="center" prop="fileName">
|
|
|
+ <template slot-scope="r">
|
|
|
+ <a :href="imageUrl(r.row.fileUrl) " style="color:#45b97c"
|
|
|
+ target="_blank">{{r.row.fileName}}</a>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-edit"
|
|
|
+ @click="handleUpdate(scope.row)"
|
|
|
+ v-hasPermi="['core:registerBook:edit']"
|
|
|
+ >修改
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-delete"
|
|
|
+ @click="handleDelete(scope.row)"
|
|
|
+ v-hasPermi="['core:registerBook:remove']"
|
|
|
+ >删除
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>-->
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <pagination
|
|
|
+ :total="total"
|
|
|
+ :page.sync="queryParams.pageNum"
|
|
|
+ :limit.sync="queryParams.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <!-- 添加或修改registerBook对话框 -->
|
|
|
+ <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
+ <el-form-item label="登记簿类型" prop="registerBookType">
|
|
|
+ <el-select v-model="form.registerBookType" placeholder="请选择登记簿类型">
|
|
|
+ <el-option
|
|
|
+ v-for="dict in dict.type.register_book_type"
|
|
|
+ :key="dict.value"
|
|
|
+ :label="dict.label"
|
|
|
+ :value="parseInt(dict.value)"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="保存日期" prop="date">
|
|
|
+ <el-date-picker clearable
|
|
|
+ v-model="form.date"
|
|
|
+ type="date"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ placeholder="请选择保存日期">
|
|
|
+ </el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="机构id" prop="orgId">
|
|
|
+ <el-input v-model="form.orgId" placeholder="请输入机构id"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="机构名称" prop="orgName">
|
|
|
+ <el-input v-model="form.orgName" placeholder="请输入机构名称"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="pdf文件地址" prop="fileUrl">
|
|
|
+ <el-input v-model="form.fileUrl" placeholder="请输入pdf文件地址"/>
|
|
|
+ </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>
|
|
|
+ <down-list-dialog ref="downListDialog" @success="refresh(true)"></down-list-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import {
|
|
|
+ listRegisterBook,
|
|
|
+ getRegisterBook,
|
|
|
+ delRegisterBook,
|
|
|
+ addRegisterBook,
|
|
|
+ updateRegisterBook
|
|
|
+} from "@/api/registerbook/registerBook.js";
|
|
|
+import tableList from "@/mixins/tableList";
|
|
|
+import DownListDialog from "./dialog.list";
|
|
|
+import OrgTree from "@/components/orgTree";
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: "RegisterBook",
|
|
|
+ dicts: ['register_book_type'],
|
|
|
+ components: {OrgTree,DownListDialog},
|
|
|
+ mixins: [tableList],
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ // 遮罩层
|
|
|
+ loading: true,
|
|
|
+ // 选中数组
|
|
|
+ ids: [],
|
|
|
+ // 非单个禁用
|
|
|
+ single: true,
|
|
|
+ // 非多个禁用
|
|
|
+ multiple: true,
|
|
|
+ // 显示搜索条件
|
|
|
+ showSearch: true,
|
|
|
+ // 总条数
|
|
|
+ total: 0,
|
|
|
+ // registerBook表格数据
|
|
|
+ registerBookList: [],
|
|
|
+ // 弹出层标题
|
|
|
+ title: "",
|
|
|
+ // 是否显示弹出层
|
|
|
+ open: false,
|
|
|
+ // 查询参数
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ registerBookType: null,
|
|
|
+ date: new Date(),
|
|
|
+ orgId: null,
|
|
|
+ },
|
|
|
+ // 表单参数
|
|
|
+ form: {},
|
|
|
+ // 表单校验
|
|
|
+ rules: {
|
|
|
+ registerBookType: [
|
|
|
+ {required: true, message: "登记簿类型不能为空", trigger: "change"}
|
|
|
+ ],
|
|
|
+ date: [
|
|
|
+ {required: true, message: "保存日期不能为空", trigger: "blur"}
|
|
|
+ ],
|
|
|
+ orgId: [
|
|
|
+ {required: true, message: "机构id不能为空", trigger: "blur"}
|
|
|
+ ],
|
|
|
+ orgName: [
|
|
|
+ {required: true, message: "机构名称不能为空", trigger: "blur"}
|
|
|
+ ],
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ /** 查询registerBook列表 */
|
|
|
+ getList() {
|
|
|
+ this.loading = true;
|
|
|
+ listRegisterBook(this.queryParams).then(response => {
|
|
|
+ this.registerBookList = response.rows;
|
|
|
+ this.total = response.total;
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ refresh(isCurrent) {
|
|
|
+ this.$refs.st[isCurrent ? "refresh" : "search"]();
|
|
|
+ },
|
|
|
+ // 取消按钮
|
|
|
+ cancel() {
|
|
|
+ this.open = false;
|
|
|
+ this.reset();
|
|
|
+ },
|
|
|
+ // 表单重置
|
|
|
+ reset() {
|
|
|
+ this.form = {
|
|
|
+ id: null,
|
|
|
+ registerBookType: null,
|
|
|
+ date: null,
|
|
|
+ orgId: null,
|
|
|
+ orgName: null,
|
|
|
+ orgPath: null,
|
|
|
+ fileUrl: null
|
|
|
+ };
|
|
|
+ this.resetForm("form");
|
|
|
+ },
|
|
|
+ getDefaultKey(key) {
|
|
|
+ this.queryParams.orgId = key;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ //单选框状态改变
|
|
|
+ checkChange(state) {
|
|
|
+ this.queryParams.checkSub = state;
|
|
|
+ this.handleQuery();
|
|
|
+ },
|
|
|
+ // 节点单击事件
|
|
|
+ clickTreeNode(data) {
|
|
|
+ this.queryParams.orgId = data.id;
|
|
|
+ this.handleQuery();
|
|
|
+ },
|
|
|
+ /** 搜索按钮操作 */
|
|
|
+ handleQuery() {
|
|
|
+ this.queryParams.pageNum = 1;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ /** 重置按钮操作 */
|
|
|
+ resetQuery() {
|
|
|
+ this.resetForm("queryForm");
|
|
|
+ this.handleQuery();
|
|
|
+ },
|
|
|
+ // 多选框选中数据
|
|
|
+ handleSelectionChange(selection) {
|
|
|
+ this.ids = selection.map(item => item.id)
|
|
|
+ this.single = selection.length !== 1
|
|
|
+ this.multiple = !selection.length
|
|
|
+ },
|
|
|
+ /** 提交按钮 */
|
|
|
+ submitForm() {
|
|
|
+ this.$refs["form"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ if (this.form.id != null) {
|
|
|
+ updateRegisterBook(this.form).then(response => {
|
|
|
+ this.$modal.msgSuccess("修改成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ addRegisterBook(this.form).then(response => {
|
|
|
+ this.$modal.msgSuccess("新增成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 删除按钮操作 */
|
|
|
+ handleDelete(row) {
|
|
|
+ const ids = row.id || this.ids;
|
|
|
+ this.$modal.confirm('是否确认删除registerBook编号为"' + ids + '"的数据项?').then(function () {
|
|
|
+ return delRegisterBook(ids);
|
|
|
+ }).then(() => {
|
|
|
+ this.getList();
|
|
|
+ this.$modal.msgSuccess("删除成功");
|
|
|
+ }).catch(() => {
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 导出按钮操作 */
|
|
|
+ handleExport() {
|
|
|
+ this.download('core/registerBook/export', {
|
|
|
+ ...this.queryParams
|
|
|
+ }, `registerBook_${new Date().getTime()}.xlsx`)
|
|
|
+ },
|
|
|
+
|
|
|
+ async exportAll() {
|
|
|
+ this.search.exportType = 0;
|
|
|
+ //await cutExport(this.search);
|
|
|
+ this.$message.success("导出成功,请稍后查看导出结果!");
|
|
|
+ },
|
|
|
+ async exportSelected() {
|
|
|
+ /*if (!this.search.pdfIdList || this.search.pdfIdList.length == 0) {
|
|
|
+ this.$message.error('请先选择需要导出的文件!');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.search.exportType = 1;
|
|
|
+ let guid = this.getNewGuid();
|
|
|
+ await this.$api.batchexport.exportFile({...this.search, guid});*/
|
|
|
+ },
|
|
|
+ getDownList() {
|
|
|
+ this.$refs.downListDialog.show(this.search);
|
|
|
+ },
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|