档案室密集柜

master
wanglei 2 years ago
parent 8acc62af28
commit b8747de8b1

@ -1,144 +1,36 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="位置名称" prop="posName">
<el-input
v-model="queryParams.posName"
placeholder="请输入位置名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="父目录ID" prop="pid">
<el-input
v-model="queryParams.pid"
placeholder="请输入父目录ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="祖级列表" prop="ancestors">
<el-input
v-model="queryParams.ancestors"
placeholder="请输入祖级列表"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="primary" type="info"
plain plain
icon="el-icon-plus" icon="el-icon-sort"
size="mini" size="mini"
@click="handleAdd" @click="toggleExpandAll"
v-hasPermi="['dangan:cabinet:add']" >展开/折叠</el-button>
>新增</el-button>
</el-col> </el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['dangan:cabinet: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="['dangan:cabinet: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="['dangan:cabinet:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="cabinetList" @selection-change="handleSelectionChange"> <el-table v-if="refreshTable" border
<el-table-column type="selection" width="55" align="center" /> v-loading="loading"
<el-table-column label="id" align="center" prop="id" /> :data="list"
<el-table-column label="位置名称" align="center" prop="posName" /> row-key="id"
:default-expand-all="isExpandAll"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}">
<el-table-column label="位置名称" header-align="center" align="left" prop="label" />
<el-table-column label="ID" align="center" prop="id" />
<el-table-column label="父目录ID" align="center" prop="pid" /> <el-table-column label="父目录ID" align="center" prop="pid" />
<el-table-column label="祖级列表" align="center" prop="ancestors" /> <!-- <el-table-column label="祖级列表" align="center" prop="ancestors" />-->
<el-table-column label="内容" align="center" prop="content" /> <el-table-column label="内容" align="center" prop="content" />
<el-table-column label="备注" align="center" prop="remark" /> <el-table-column label="备注" align="center" prop="remark" />
<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="['dangan:cabinet:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['dangan:cabinet:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table> </el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改档案柜对话框 -->
<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="posName">
<el-input v-model="form.posName" placeholder="请输入位置名称" />
</el-form-item>
<el-form-item label="父目录ID" prop="pid">
<el-input v-model="form.pid" placeholder="请输入父目录ID" />
</el-form-item>
<el-form-item label="内容">
<editor v-model="form.content" :min-height="192"/>
</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> </div>
</template> </template>
<script> <script>
import { listCabinet, getCabinet, delCabinet, addCabinet, updateCabinet } from "@/api/dangan/cabinet"; import { getCabinetTree } from "@/api/dangan/cabinet";
export default { export default {
name: "Cabinet", name: "Cabinet",
@ -148,37 +40,12 @@ export default {
loading: true, loading: true,
// //
ids: [], ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
// //
cabinetList: [], list: [],
// //
title: "", isExpandAll: false,
// //
open: false, refreshTable: true,
//
queryParams: {
pageNum: 1,
pageSize: 10,
posName: null,
pid: null,
ancestors: null,
content: null,
},
//
form: {},
//
rules: {
posName: [
{ required: true, message: "位置名称不能为空", trigger: "blur" }
],
}
}; };
}, },
created() { created() {
@ -188,101 +55,19 @@ export default {
/** 查询档案柜列表 */ /** 查询档案柜列表 */
getList() { getList() {
this.loading = true; this.loading = true;
listCabinet(this.queryParams).then(response => { getCabinetTree(this.queryParams).then(response => {
this.cabinetList = response.rows; this.list = response.data;
this.total = response.total;
this.loading = false; this.loading = false;
}); });
}, },
// /** 展开/折叠操作 */
cancel() { toggleExpandAll() {
this.open = false; this.refreshTable = false;
this.reset(); this.isExpandAll = !this.isExpandAll;
}, this.$nextTick(() => {
// this.refreshTable = true;
reset() {
this.form = {
id: null,
posName: null,
pid: null,
ancestors: null,
content: null,
remark: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
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
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加档案柜";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getCabinet(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改档案柜";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateCabinet(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addCabinet(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
}); });
}, },
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除档案柜编号为"' + ids + '"的数据项?').then(function() {
return delCabinet(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('dangan/cabinet/export', {
...this.queryParams
}, `cabinet_${new Date().getTime()}.xlsx`)
}
} }
}; };
</script> </script>

@ -70,25 +70,24 @@
</el-row> </el-row>
<el-dialog title="档案文件上传" :visible.sync="upload.open" width="700px" append-to-body> <el-dialog title="档案文件上传" :visible.sync="upload.open" width="700px" append-to-body>
<div style="margin-bottom: 30px;display: flex;min-height: 250px" v-loading="upload.loading"> <div style="margin-bottom: 30px;display: flex;min-height: 300px;" v-loading="upload.loading">
<div style="width:250px;border: 1px solid #eee; padding: 10px;"> <div style="width:250px;border: 1px solid #eee; padding: 10px;max-height: 500px;overflow-y: auto">
<div style="margin-bottom: 5px;">物理书架</div> <div style="margin-bottom: 5px;">档案室密集柜</div>
<el-tree <el-tree
:data="shuJiaOptions" :data="shuJiaOptions"
:props="{ :props="{
children: 'children', children: 'children',
label: 'name' label: 'label'
}" }"
:expand-on-click-node="false" :expand-on-click-node="false"
ref="myTreeSelect" ref="myTreeSelect"
node-key="shelfId" node-key="id"
default-expand-all
highlight-current highlight-current
@node-click="selectTree" @node-click="selectTree"
/> />
</div> </div>
<div v-show="upload.shelfId" style="width: 360px;margin-left: 20px;"> <div v-show="upload.id" style="width: 360px;margin-left: 20px;">
<el-upload :show-file-list="false" :fileSize="200" <el-upload :show-file-list="false" :fileSize="200"
ref="upload" ref="upload"
action="#" action="#"
@ -126,25 +125,24 @@
</el-dialog> </el-dialog>
<el-dialog title="扫描文件上传" :visible.sync="smwj.open" width="1000px" append-to-body> <el-dialog title="扫描文件上传" :visible.sync="smwj.open" width="1000px" append-to-body>
<div style="margin-bottom: 30px;display: flex;align-items:start;min-height: 250px;" v-loading="smwj.loading"> <div style="margin-bottom: 30px;display: flex;align-items:start;min-height: 300px;" v-loading="smwj.loading">
<div style="width:250px;border: 1px solid #eee; padding: 10px;"> <div style="width:250px;border: 1px solid #eee; padding: 10px;max-height: 500px;overflow-y: auto">
<div style="margin-bottom: 5px;">物理书架</div> <div style="margin-bottom: 5px;">档案室密集柜</div>
<el-tree <el-tree
:data="shuJiaOptions" :data="shuJiaOptions"
:props="{ :props="{
children: 'children', children: 'children',
label: 'name' label: 'label'
}" }"
:expand-on-click-node="false" :expand-on-click-node="false"
ref="myTreeSelect" ref="myTreeSelect"
node-key="shelfId" node-key="id"
default-expand-all
highlight-current highlight-current
@node-click="selectTree1" @node-click="selectTree1"
/> />
</div> </div>
<div v-if="smwj.shelfId && smwj.list.length===0" style="width: 650px;margin-left: 20px;" v-loading="smwj.smloading" element-loading-text="" <div v-if="smwj.id && smwj.list.length===0" style="width: 650px;margin-left: 20px;" v-loading="smwj.smloading" element-loading-text=""
element-loading-spinner="el-icon-loading"> element-loading-spinner="el-icon-loading">
<div> <div>
<el-row class="sm_row" :gutter="20"> <el-row class="sm_row" :gutter="20">
@ -179,7 +177,7 @@
</div> </div>
<div v-if="smwj.shelfId && smwj.list.length>0" style="width: 560px;margin-left: 20px;display: flex;flex-wrap: wrap"> <div v-if="smwj.id && smwj.list.length>0" style="width: 560px;margin-left: 20px;display: flex;flex-wrap: wrap">
<div v-for="(item,index) in smwj.list" class="smwjList"> <div v-for="(item,index) in smwj.list" class="smwjList">
<el-image <el-image
@ -213,7 +211,7 @@
import { catalogTreeselect } from "@/api/system/user"; import { catalogTreeselect } from "@/api/system/user";
import Treeselect from "@riophae/vue-treeselect"; import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { listBookshelf } from "@/api/dangan/bookshelf"; import { getCabinetTree } from "@/api/dangan/cabinet";
import { collectSaves, collectRecongnize } from "@/api/dangan/collection"; import { collectSaves, collectRecongnize } from "@/api/dangan/collection";
import '@/utils/WebScan'; import '@/utils/WebScan';
import axios from 'axios' import axios from 'axios'
@ -249,7 +247,7 @@ export default {
loading: false, loading: false,
// //
open: false, open: false,
shelfId: undefined, id: undefined,
wlsjNode: undefined wlsjNode: undefined
}, },
// //
@ -263,7 +261,7 @@ export default {
smloading: false, smloading: false,
// //
open: false, open: false,
shelfId: undefined, id: undefined,
wlsjNode: undefined, wlsjNode: undefined,
list: [] list: []
}, },
@ -279,7 +277,6 @@ export default {
} }
}, },
created() { created() {
console.log(this.$store.state.user.name);
this.getDeptTree(); this.getDeptTree();
}, },
methods: { methods: {
@ -436,7 +433,7 @@ export default {
this.$modal.confirm(`是否确认选择【${this.dangAnNode.label}】档案目录?`).then(() => { this.$modal.confirm(`是否确认选择【${this.dangAnNode.label}】档案目录?`).then(() => {
this.getTreeselect(); this.getTreeselect();
this.fileList = [] this.fileList = []
this.upload.shelfId=undefined; this.upload.id=undefined;
this.upload.wlsjNode=undefined; this.upload.wlsjNode=undefined;
this.upload.open = true; this.upload.open = true;
}).catch(() => { }).catch(() => {
@ -454,7 +451,7 @@ export default {
this.$modal.confirm(`是否确认选择【${this.dangAnNode.label}】档案目录?`).then(() => { this.$modal.confirm(`是否确认选择【${this.dangAnNode.label}】档案目录?`).then(() => {
this.getTreeselect(); this.getTreeselect();
this.smwj.list = []; this.smwj.list = [];
this.smwj.shelfId=undefined; this.smwj.id=undefined;
this.smwj.wlsjNode=undefined; this.smwj.wlsjNode=undefined;
this.smwj.open = true; this.smwj.open = true;
}).catch(() => { }).catch(() => {
@ -468,8 +465,8 @@ export default {
}, },
/** 查询目录下拉树结构 */ /** 查询目录下拉树结构 */
getTreeselect() { getTreeselect() {
listBookshelf().then(response => { getCabinetTree().then(response => {
this.shuJiaOptions = this.handleTree(response.rows, "shelfId", "pid") this.shuJiaOptions = response.data
}); });
}, },
// //
@ -537,14 +534,14 @@ export default {
} }
} }
}, },
// //
selectTree(data, Node) { selectTree(data, Node) {
this.upload.shelfId = data.shelfId; this.upload.id = data.id;
this.upload.wlsjNode = Node; this.upload.wlsjNode = Node;
}, },
// //
selectTree1(data, Node) { selectTree1(data, Node) {
this.smwj.shelfId = data.shelfId; this.smwj.id = data.id;
this.smwj.wlsjNode = Node; this.smwj.wlsjNode = Node;
}, },
// label // label
@ -596,7 +593,6 @@ export default {
this.percentage = 0; this.percentage = 0;
this.openProgress = true; this.openProgress = true;
collectRecongnize(arr).then(response => { collectRecongnize(arr).then(response => {
console.log(3232,response);
if(response.fails&&response.fails.length>0){ if(response.fails&&response.fails.length>0){
this.pictureRecard = response.fails this.pictureRecard = response.fails
this.isFails = true; this.isFails = true;
@ -663,12 +659,9 @@ export default {
} }
}) })
.then( (response)=> { .then( (response)=> {
console.log(response.data.file_counts);
this.percentage = Math.round((response.data.file_counts/this.pictureRecard.length)*100); this.percentage = Math.round((response.data.file_counts/this.pictureRecard.length)*100);
console.log(this.percentage);
}).catch((error)=> { }).catch((error)=> {
// //
console.log(error);
}) })
}, },
} }

Loading…
Cancel
Save