电子档案管理
This commit is contained in:
parent
40a290936d
commit
c6ec188406
|
|
@ -0,0 +1,70 @@
|
||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
//左侧树
|
||||||
|
export function getArchivesTypeListApi(query) {
|
||||||
|
return request({
|
||||||
|
url: '/material/archives/getTypeList ',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//左侧树-新增
|
||||||
|
export function getAddArchivesTypeApi(data) {
|
||||||
|
return request({
|
||||||
|
url: '/material/archives/add',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//左侧树-编辑
|
||||||
|
export function updateArchivesTypeApi(data) {
|
||||||
|
return request({
|
||||||
|
url: '/material/archives/update',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//左侧树-删除
|
||||||
|
export function delArchivesTypeApi(data) {
|
||||||
|
return request({
|
||||||
|
url: '/material/archives/deleteById',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
//右侧表格-文件数据
|
||||||
|
export function getArchivesDetailsLstApi(query) {
|
||||||
|
return request({
|
||||||
|
url: '/material/archives/getDetailsList',
|
||||||
|
method: 'get',
|
||||||
|
params: query,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//右侧表格-新增
|
||||||
|
export function addArchivesDetailsApi(data) {
|
||||||
|
return request({
|
||||||
|
url: '/material/archives/addDetails',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//右侧表格-编辑
|
||||||
|
export function updateArchivesDetailsApi(data) {
|
||||||
|
return request({
|
||||||
|
url: '/material/archives/updateDetails',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//右侧表格-删除
|
||||||
|
export function delArchivesDetailsApi(data) {
|
||||||
|
return request({
|
||||||
|
url: '/material/archives/deleteByDetails',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -4,9 +4,9 @@
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<!--树数据-->
|
<!--树数据-->
|
||||||
<el-col :span="5" :xs="24">
|
<el-col :span="5" :xs="24">
|
||||||
<div class="head-container">
|
<div class="head-container" style="display: flex;">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="typeName"
|
v-model="archivesName"
|
||||||
placeholder="请输入关键字"
|
placeholder="请输入关键字"
|
||||||
clearable
|
clearable
|
||||||
maxlength="50"
|
maxlength="50"
|
||||||
|
|
@ -14,6 +14,11 @@
|
||||||
prefix-icon="el-icon-search"
|
prefix-icon="el-icon-search"
|
||||||
style="margin-bottom: 20px"
|
style="margin-bottom: 20px"
|
||||||
/>
|
/>
|
||||||
|
<el-button
|
||||||
|
size="mini" style="margin: 0 10px;height: 32px;" type="primary"
|
||||||
|
@click.stop="() => addTreeMainType()">
|
||||||
|
新建分类
|
||||||
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="head-container" style>
|
<div class="head-container" style>
|
||||||
<el-tree
|
<el-tree
|
||||||
|
|
@ -72,143 +77,71 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<!--表格数据-->
|
<!--表格数据-->
|
||||||
<el-col :span="19" :xs="24">
|
<el-col :span="19" :xs="24">
|
||||||
<el-form
|
<!-- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
:model="queryParams"
|
|
||||||
ref="queryForm"
|
|
||||||
size="small"
|
|
||||||
:inline="true"
|
|
||||||
v-show="showSearch"
|
|
||||||
label-width="68px"
|
|
||||||
>
|
|
||||||
<el-form-item label="关键字" prop="keyword">
|
<el-form-item label="关键字" prop="keyword">
|
||||||
<el-input
|
<el-input v-model="queryParams.keyword" placeholder="请输入关键字" clearable style="width: 240px" @keyup.enter.native="handleQuery"/>
|
||||||
v-model="queryParams.keyword"
|
|
||||||
placeholder="请输入关键字"
|
|
||||||
clearable
|
|
||||||
style="width: 240px"
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">查询</el-button>
|
||||||
type="primary"
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
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-item>
|
||||||
</el-form>
|
</el-form> -->
|
||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="16" style="margin-bottom: 20px;">
|
||||||
<el-col :span="1.5">
|
<el-col :span="2">
|
||||||
<el-button
|
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="">上传</el-button>
|
||||||
type="warning"
|
</el-col>
|
||||||
plain
|
<el-col :span="2">
|
||||||
icon="el-icon-download"
|
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">下载</el-button>
|
||||||
size="mini"
|
</el-col>
|
||||||
@click="handleExport"
|
<el-col :span="2">
|
||||||
>导出
|
<el-button type="warning" plain icon="el-icon-download" :disabled="single" size="mini" @click="handleReName">重命名</el-button>
|
||||||
</el-button>
|
</el-col>
|
||||||
|
<el-col :span="2">
|
||||||
|
<el-button type="warning" plain icon="el-icon-download" :disabled="multiple" size="mini" @click="handleAllDel">删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="4" style="float: right;">
|
||||||
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">新建文件夹</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar
|
|
||||||
:showSearch.sync="showSearch"
|
|
||||||
@queryTable="getList"
|
|
||||||
></right-toolbar>
|
|
||||||
</el-row>
|
</el-row>
|
||||||
|
<el-row :gutter="10" style="margin-bottom: 20px;">
|
||||||
<el-table
|
<el-breadcrumb separator-class="el-icon-arrow-right">
|
||||||
v-loading="loading"
|
<el-breadcrumb-item v-for="(item,index) in breadcrumbList" :key="item.id">
|
||||||
:data="tableDataList"
|
<span @click="breadClick(item,index)" style="cursor: pointer;">{{item.docName}}</span>
|
||||||
border
|
</el-breadcrumb-item>
|
||||||
@selection-change="handleSelectionChange"
|
</el-breadcrumb>
|
||||||
>
|
</el-row>
|
||||||
|
<el-table v-loading="loading" :data="tableDataList" @selection-change="handleSelectionChange" row-key="detailsId">
|
||||||
|
<el-table-column type="selection" width="55" align="center"/>
|
||||||
<el-table-column label="序号" align="center" width="80" type="index">
|
<el-table-column label="序号" align="center" width="80" type="index">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{(queryParams.pageNum - 1) * 10 + scope.$index + 1}}</span>
|
<span>{{(queryParams.pageNum - 1) * 10 + scope.$index + 1}}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column label="文件名称" align="left" prop="docName" show-overflow-tooltip width="300">
|
||||||
label="类型编码"
|
|
||||||
align="center"
|
|
||||||
key="typeCode"
|
|
||||||
prop="typeCode"
|
|
||||||
show-overflow-tooltip
|
|
||||||
v-if="false"
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
label="仓库信息"
|
|
||||||
align="center"
|
|
||||||
key="houseName"
|
|
||||||
prop="houseName"
|
|
||||||
show-overflow-tooltip
|
|
||||||
v-if="false"
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
label="施工类型"
|
|
||||||
align="center"
|
|
||||||
key="itemType"
|
|
||||||
prop="itemType"
|
|
||||||
show-overflow-tooltip
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
label="物资类型"
|
|
||||||
align="center"
|
|
||||||
key="materialType"
|
|
||||||
prop="materialType"
|
|
||||||
show-overflow-tooltip
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
label="物资名称"
|
|
||||||
align="center"
|
|
||||||
key="materialName"
|
|
||||||
prop="materialName"
|
|
||||||
show-overflow-tooltip
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
label="规格型号"
|
|
||||||
align="center"
|
|
||||||
key="typeName"
|
|
||||||
prop="typeName"
|
|
||||||
show-overflow-tooltip
|
|
||||||
>
|
|
||||||
</el-table-column>
|
|
||||||
|
|
||||||
<el-table-column label="操作" align="center" width="180">
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<i v-if="scope.row.docType=='文件夹'" class="el-icon-folder-opened"></i>
|
||||||
size="mini"
|
<span @click="getSubDetails(scope.row)" style="cursor: pointer;margin-left: 20px;">{{ scope.row.docName }}</span>
|
||||||
type="text"
|
</template>
|
||||||
icon="el-icon-edit"
|
</el-table-column>
|
||||||
@click="handleView(scope.row)"
|
<el-table-column label="" align="center" width="300">
|
||||||
v-hasPermi="['ma:type:query']"
|
<template slot-scope="scope">
|
||||||
>
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleView(scope.row)">
|
||||||
查看
|
查看
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">
|
||||||
size="mini"
|
重命名
|
||||||
type="text"
|
|
||||||
icon="el-icon-edit"
|
|
||||||
@click="handleUpdate(scope.row)"
|
|
||||||
v-hasPermi="['ma:type:edit']"
|
|
||||||
>
|
|
||||||
编辑
|
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
v-hasPermi="['ma:type:remove']"
|
|
||||||
>
|
|
||||||
删除
|
删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<el-table-column label="类 型 " align="center" prop="docType" show-overflow-tooltip/>
|
||||||
|
<el-table-column label="年 度" align="center" prop="year" show-overflow-tooltip/>
|
||||||
|
<el-table-column label="修改时间 " align="center" prop="updateTime" show-overflow-tooltip/>
|
||||||
|
<el-table-column label="上传人员 " align="center" prop="createBy" show-overflow-tooltip/>
|
||||||
|
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<pagination
|
||||||
|
|
@ -226,46 +159,56 @@
|
||||||
<img width="100%" height="650px" :src="dialogImageUrl" alt />
|
<img width="100%" height="650px" :src="dialogImageUrl" alt />
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<!-- 新增弹框 -->
|
<!-- 新增弹框(新建弹窗) -->
|
||||||
<el-dialog
|
<el-dialog :title="addTitle" :visible.sync="addShowVisible" v-if="addShowVisible" width="500px" append-to-body :close-on-click-modal="false">
|
||||||
:title="addTitle"
|
<el-form label-width="80px" :model="addFormParams" :rules="addFormParamsRules" ref="addFormParamsRef">
|
||||||
:visible.sync="addShowVisible"
|
|
||||||
v-if="addShowVisible"
|
|
||||||
width="50%"
|
|
||||||
append-to-body
|
|
||||||
:close-on-click-modal="false"
|
|
||||||
>
|
|
||||||
<el-form
|
|
||||||
label-width="80px"
|
|
||||||
:model="addFormParams"
|
|
||||||
:rules="addFormParamsRules"
|
|
||||||
ref="addFormParamsRef"
|
|
||||||
>
|
|
||||||
<el-row :gutter="24">
|
<el-row :gutter="24">
|
||||||
<el-col :span="12" v-if="addTitle === '新增'">
|
<el-col :span="24" v-if="addTitle === '新增'">
|
||||||
<el-form-item label="所属上级">
|
<el-form-item label="所属上级">
|
||||||
<el-input
|
<el-input style="width: 100%" disabled v-model="addFormParams.label"/>
|
||||||
style="width: 100%"
|
</el-form-item>
|
||||||
disabled
|
</el-col>
|
||||||
v-model="addFormParams.label"
|
</el-row>
|
||||||
/>
|
<el-row :gutter="24">
|
||||||
</el-form-item>
|
<el-col :span="24">
|
||||||
</el-col>
|
<el-form-item label="名称" prop="archivesName">
|
||||||
<el-col :span="12">
|
<el-input style="width: 100%" v-model="addFormParams.archivesName" />
|
||||||
<el-form-item label="名称" prop="typeName">
|
|
||||||
<el-input style="width: 100%" v-model="addFormParams.typeName" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<el-row style="text-align: right">
|
<el-row style="text-align: right">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button size="small" type="primary" style="color: #fff;" @click="onSubmit">确 定</el-button>
|
<el-button size="small" type="primary" style="color: #fff;" @click="onSubmit">保 存</el-button>
|
||||||
<el-button size="small" @click="onCancel">取 消</el-button>
|
<el-button size="small" @click="onCancel">取 消</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
<!-- 重命名弹框-->
|
||||||
|
<el-dialog title="重命名文件" :visible.sync="reNameShowVisible" width="500px" append-to-body :close-on-click-modal="false">
|
||||||
|
<el-form label-width="80px" :model="reNameForm" :rules="reNameFormRules" ref="reNameForm">
|
||||||
|
<el-row :gutter="24">
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="旧的名称:">
|
||||||
|
<el-input style="width: 100%" disabled v-model="reNameForm.oldName"/>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row :gutter="24">
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="新的名称" prop="newName">
|
||||||
|
<el-input style="width: 100%" v-model="reNameForm.newName" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<el-row style="text-align: right">
|
||||||
|
<el-form-item>
|
||||||
|
<el-button size="small" type="primary" style="color: #fff;" @click="saveName">保 存</el-button>
|
||||||
|
<el-button size="small" @click="reNameShowVisible=false">取 消</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -273,16 +216,12 @@
|
||||||
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 {
|
import {
|
||||||
getMaTypeList,
|
getArchivesTypeListApi,getAddArchivesTypeApi,updateArchivesTypeApi,delArchivesTypeApi,
|
||||||
getListByMaType,
|
getArchivesDetailsLstApi, addArchivesDetailsApi, updateArchivesDetailsApi, delArchivesDetailsApi
|
||||||
getMaType,
|
} from "@/api/archives/archives";
|
||||||
queryKeeperDataApi,
|
|
||||||
delMaType,
|
|
||||||
addMaType,
|
|
||||||
updateMaType,
|
|
||||||
} from "@/api/ma/base";
|
|
||||||
import { imgUpLoad } from "@/api/system/upload";
|
import { imgUpLoad } from "@/api/system/upload";
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "ToolsType",
|
name: "ToolsType",
|
||||||
components: { Treeselect },
|
components: { Treeselect },
|
||||||
|
|
@ -306,7 +245,7 @@ export default {
|
||||||
KeeperOptions: [],//选择库管员数据
|
KeeperOptions: [],//选择库管员数据
|
||||||
repairerOptions: [],//维修员用户数据
|
repairerOptions: [],//维修员用户数据
|
||||||
// 类型名称
|
// 类型名称
|
||||||
typeName: undefined,
|
archivesName: undefined,
|
||||||
// 左侧树-树选项
|
// 左侧树-树选项
|
||||||
treeOptions: undefined,
|
treeOptions: undefined,
|
||||||
treeTemp: [],
|
treeTemp: [],
|
||||||
|
|
@ -330,9 +269,7 @@ export default {
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10
|
||||||
typeName: undefined,
|
|
||||||
level: 0,
|
|
||||||
},
|
},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
|
|
@ -351,12 +288,12 @@ export default {
|
||||||
addShowVisible: false,
|
addShowVisible: false,
|
||||||
addTitle: "", // 新增弹框标题
|
addTitle: "", // 新增弹框标题
|
||||||
addFormParams: {
|
addFormParams: {
|
||||||
label: "",
|
infoId: "",
|
||||||
typeName: "",
|
level: "",
|
||||||
companyId: 101,
|
archivesName: ""
|
||||||
},
|
},
|
||||||
addFormParamsRules: {
|
addFormParamsRules: {
|
||||||
typeName: [
|
archivesName: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: "名称不能为空",
|
message: "名称不能为空",
|
||||||
|
|
@ -365,11 +302,29 @@ export default {
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
isMousemoveId: null,
|
isMousemoveId: null,
|
||||||
|
breadcrumbList:[],//面包屑导航数组
|
||||||
|
rowData:{},
|
||||||
|
reNameShowVisible: false,
|
||||||
|
reNameForm:{
|
||||||
|
oldName:"",
|
||||||
|
newName:""
|
||||||
|
},
|
||||||
|
reNameFormRules: {
|
||||||
|
newName: [
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
message: "名称不能为空",
|
||||||
|
trigger: "blur",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
// 根据名称筛选部门树
|
// 根据名称筛选部门树
|
||||||
typeName(val) {
|
archivesName(val) {
|
||||||
this.$refs.tree.filter(val);
|
this.$refs.tree.filter(val);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
@ -379,227 +334,31 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
/** 查询新增页面-上级类型下拉树结构 */
|
/** 查询新增页面-上级类型下拉树结构 */
|
||||||
getTreeData() {
|
getTreeData() {
|
||||||
getMaTypeList().then((response) => {
|
getArchivesTypeListApi().then((response) => {
|
||||||
this.treeOptions = response.data;
|
this.treeOptions = response.data;
|
||||||
console.log(this.treeOptions)
|
console.log(this.treeOptions)
|
||||||
if (this.treeOptions.length > 0 ){
|
if (this.treeOptions.length > 0 ){
|
||||||
if(this.treeOptions[0].children&&this.treeOptions[0].children.length > 0) {
|
if(this.treeOptions[0].children&&this.treeOptions[0].children.length > 0) {
|
||||||
const firstNode = this.treeOptions[0].children[0];
|
const firstNode = this.treeOptions[0].children[0];
|
||||||
this.queryParams.typeId = firstNode.id;
|
this.queryParams.infoId = firstNode.id;
|
||||||
this.queryParams.level = 1;
|
let obj = {
|
||||||
this.queryParams.houseId = firstNode.houseId;
|
id:0,
|
||||||
this.getList();
|
infoId:firstNode.id,
|
||||||
}else{
|
detailsId:'',
|
||||||
this.queryParams.typeId = this.treeOptions[0].id;
|
level:'',
|
||||||
this.queryParams.level = 0;
|
docName:firstNode.label
|
||||||
this.queryParams.houseId = this.treeOptions[0].id;
|
}
|
||||||
|
this.breadcrumbList.push(obj)
|
||||||
this.getList();
|
this.getList();
|
||||||
}
|
}
|
||||||
}
|
// else{
|
||||||
});
|
// this.queryParams.typeId = this.treeOptions[0].id;
|
||||||
},
|
// this.queryParams.level = 0;
|
||||||
/** 查询列表 */
|
|
||||||
getList() {
|
|
||||||
this.loading = true;
|
|
||||||
getListByMaType(this.queryParams).then((response) => {
|
|
||||||
this.tableDataList = response.data.rows;
|
|
||||||
this.total = response.data.total;
|
|
||||||
this.loading = false;
|
|
||||||
});
|
|
||||||
},
|
|
||||||
// 筛选节点 - 左侧树
|
|
||||||
filterNode(value, data) {
|
|
||||||
if (!value) return true;
|
|
||||||
return data.label.indexOf(value) !== -1;
|
|
||||||
},
|
|
||||||
// 节点单击事件 - 左侧树
|
|
||||||
async handleNodeClick(data, node) {
|
|
||||||
if (data.level == 0) {
|
|
||||||
this.queryParams.typeId = data.id;
|
|
||||||
this.queryParams.level = data.level;
|
|
||||||
this.queryParams.houseId = data.id;
|
|
||||||
} else {
|
|
||||||
this.queryParams.typeId = data.id;
|
|
||||||
this.queryParams.level = data.level;
|
|
||||||
this.queryParams.houseId = data.houseId;
|
|
||||||
}
|
|
||||||
this.handleQuery();
|
|
||||||
if (node.level == 1) {
|
|
||||||
this.form.keeperData = data.id;
|
|
||||||
} else if (node.level == 2) {
|
|
||||||
this.form.keeperDataPro = data.id;
|
|
||||||
} else if (node.level == 3) {
|
|
||||||
this.form.keeperDataPro = data.id;
|
|
||||||
this.form.keeperDataMat = data.id;
|
|
||||||
} else if (node.level == 4) {
|
|
||||||
this.form.keeperDataPro = data.id;
|
|
||||||
this.form.keeperDataMat = data.id;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
handleQuery() {
|
|
||||||
this.queryParams.pageNum = 1;
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
resetQuery() {
|
|
||||||
this.resetForm("queryForm");
|
|
||||||
this.queryParams.typeId = undefined;
|
|
||||||
this.queryParams.pageNum = 1;
|
|
||||||
this.queryParams.pageSize = 10;
|
|
||||||
this.queryParams.level = 0;
|
|
||||||
this.$refs.tree.setCurrentKey(null);
|
|
||||||
this.handleQuery();
|
|
||||||
},
|
|
||||||
// 多选框选中数据
|
|
||||||
handleSelectionChange(selection) {
|
|
||||||
this.ids = selection.map((item) => item.typeId);
|
|
||||||
this.single = selection.length != 1;
|
|
||||||
this.multiple = !selection.length;
|
|
||||||
},
|
|
||||||
// 取消按钮
|
|
||||||
cancel() {
|
|
||||||
this.open = false;
|
|
||||||
this.reset();
|
|
||||||
},
|
|
||||||
// 表单重置
|
|
||||||
reset() {
|
|
||||||
this.form = { parentId: ""};
|
|
||||||
this.resetForm("form");
|
|
||||||
},
|
|
||||||
//查看
|
|
||||||
handleView(row) {
|
|
||||||
console.log(row)
|
|
||||||
},
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
handleUpdate(row) {
|
|
||||||
this.reset();
|
|
||||||
// this.open = true;
|
|
||||||
// this.title = "重命名文件";
|
|
||||||
},
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
handleDelete(row) {
|
|
||||||
// const typeId = row.typeId;
|
|
||||||
// this.$modal
|
|
||||||
// .confirm("是否确认删除数据项?")
|
|
||||||
// .then(function () {
|
|
||||||
// return delMaType(typeId);
|
|
||||||
// })
|
|
||||||
// .then(() => {
|
|
||||||
// this.$modal.msgSuccess("删除成功");
|
|
||||||
// this.getList();
|
// this.getList();
|
||||||
// this.getTreeData();
|
// }
|
||||||
// })
|
|
||||||
// .catch(() => {});
|
|
||||||
},
|
|
||||||
/** 导出按钮作 */
|
|
||||||
handleExport() {
|
|
||||||
let queryTemp = this.queryParams;
|
|
||||||
// queryTemp.level = 0;
|
|
||||||
this.download(
|
|
||||||
"/material/ma_type/export",
|
|
||||||
{
|
|
||||||
...queryTemp,
|
|
||||||
},
|
|
||||||
`物资类型信息_${new Date().getTime()}.xlsx`
|
|
||||||
);
|
|
||||||
},
|
|
||||||
// /* 树节点操作 */
|
|
||||||
// treeChange(val) {
|
|
||||||
// console.log(val, "树节点");
|
|
||||||
// this.form.companyId = val.companyId;
|
|
||||||
// },
|
|
||||||
|
|
||||||
/* 树节点增加 */
|
|
||||||
appendTreeNode(data) {
|
|
||||||
this.levelTemp = data.level;
|
|
||||||
this.idTemp = data.id;
|
|
||||||
if (data.level === 3) {
|
|
||||||
this.reset();
|
|
||||||
Object.assign(this.form, data);
|
|
||||||
this.form.parentId = data.id;
|
|
||||||
this.open = true;
|
|
||||||
this.title = "新增";
|
|
||||||
} else {
|
|
||||||
Object.assign(this.addFormParams, data);
|
|
||||||
this.addFormParams.typeName = "";
|
|
||||||
this.addTitle = "新增";
|
|
||||||
this.addShowVisible = true;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
/* 树节点删除 */
|
|
||||||
removeTreeNode(data) {
|
|
||||||
this.$message.success('删除--')
|
|
||||||
console.log(data, "删除时的数据源--");
|
|
||||||
// const typeId = data.id;
|
|
||||||
// this.$modal
|
|
||||||
// .confirm("是否确认删除数据项?")
|
|
||||||
// .then(function () {
|
|
||||||
// return delMaType(typeId);
|
|
||||||
// })
|
|
||||||
// .then(() => {
|
|
||||||
// this.$modal.msgSuccess("删除成功");
|
|
||||||
// this.getTreeData();
|
|
||||||
// })
|
|
||||||
// .catch(() => {});
|
|
||||||
},
|
|
||||||
/* 树节点修改 */
|
|
||||||
editTreeNode(data) {
|
|
||||||
this.levelTemp = data.level;
|
|
||||||
this.idTemp = data.id;
|
|
||||||
this.parentId = data.parentId;
|
|
||||||
console.log("data", data);
|
|
||||||
Object.assign(this.addFormParams, data);
|
|
||||||
this.addTitle = "修改";
|
|
||||||
this.addFormParams.typeName = data.label;
|
|
||||||
this.addShowVisible = true;
|
|
||||||
},
|
|
||||||
/* 确定 */
|
|
||||||
onSubmit() {
|
|
||||||
const { id, typeName } = this.addFormParams;
|
|
||||||
console.log("level", this.levelTemp);
|
|
||||||
console.log("idTemp", this.idTemp);
|
|
||||||
const addParams = {
|
|
||||||
parentId: this.levelTemp == 0 ? 0 : this.idTemp,
|
|
||||||
typeName,
|
|
||||||
level: this.levelTemp,
|
|
||||||
houseId: this.levelTemp == 0 ? id : null,
|
|
||||||
};
|
|
||||||
|
|
||||||
const editParams = {
|
|
||||||
houseId: id,
|
|
||||||
typeName,
|
|
||||||
level: this.levelTemp,
|
|
||||||
parentId: this.parentId,
|
|
||||||
typeId: id,
|
|
||||||
};
|
|
||||||
|
|
||||||
this.$refs["addFormParamsRef"].validate(async (valid) => {
|
|
||||||
if (valid) {
|
|
||||||
if (this.addTitle === "新增") {
|
|
||||||
const res = await addMaType(addParams);
|
|
||||||
if (res.code === 200) {
|
|
||||||
this.$message.success("新增成功!");
|
|
||||||
this.addShowVisible = false;
|
|
||||||
this.getList();
|
|
||||||
this.getTreeData();
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
const res = await updateMaType(editParams);
|
|
||||||
if (res.code === 200) {
|
|
||||||
this.$message.success("修改成功!");
|
|
||||||
this.addShowVisible = false;
|
|
||||||
this.getList();
|
|
||||||
this.getTreeData();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/* 取消 */
|
|
||||||
onCancel() {
|
|
||||||
this.addShowVisible = false;
|
|
||||||
},
|
|
||||||
// 获取父级名称
|
// 获取父级名称
|
||||||
getParentName(list, id) {
|
getParentName(list, id) {
|
||||||
try {
|
try {
|
||||||
|
|
@ -621,6 +380,303 @@ export default {
|
||||||
onMouseleave() {
|
onMouseleave() {
|
||||||
this.isMousemoveId = null;
|
this.isMousemoveId = null;
|
||||||
},
|
},
|
||||||
|
// treeChange(val) {
|
||||||
|
// console.log(val, "树节点");
|
||||||
|
// this.form.companyId = val.companyId;
|
||||||
|
// },
|
||||||
|
//树节点新建按钮
|
||||||
|
addTreeMainType(){
|
||||||
|
this.addTitle = "新建类别";
|
||||||
|
this.addFormParams.archivesName=""
|
||||||
|
this.addShowVisible = true;
|
||||||
|
},
|
||||||
|
/* 树节点增加 */
|
||||||
|
appendTreeNode(data) {
|
||||||
|
console.log(data)
|
||||||
|
this.levelTemp = data.level;
|
||||||
|
this.idTemp = data.id;
|
||||||
|
this.parentId = data.parentId;
|
||||||
|
Object.assign(this.addFormParams, data);
|
||||||
|
this.addFormParams.archivesName = "";
|
||||||
|
this.addTitle = "新增";
|
||||||
|
this.addShowVisible = true;
|
||||||
|
},
|
||||||
|
/* 树节点删除 */
|
||||||
|
removeTreeNode(data) {
|
||||||
|
// this.$message.success('删除--')
|
||||||
|
console.log(data, "删除时的数据源--");
|
||||||
|
let delParam = {
|
||||||
|
infoId: data.id,
|
||||||
|
parentId: data.parentId,
|
||||||
|
}
|
||||||
|
this.$modal
|
||||||
|
.confirm("是否确认删除数据项?")
|
||||||
|
.then(function () {
|
||||||
|
return delArchivesTypeApi(delParam);
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
this.getTreeData();
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
/* 树节点修改 */
|
||||||
|
editTreeNode(data) {
|
||||||
|
this.levelTemp = data.level;
|
||||||
|
this.idTemp = data.id;
|
||||||
|
this.parentId = data.parentId;
|
||||||
|
Object.assign(this.addFormParams, data);
|
||||||
|
this.addTitle = "修改";
|
||||||
|
this.addFormParams.archivesName = data.label;
|
||||||
|
this.addShowVisible = true;
|
||||||
|
},
|
||||||
|
/* 新增编辑弹框-确认按钮 */
|
||||||
|
onSubmit() {
|
||||||
|
const addParams = {
|
||||||
|
infoId: this.idTemp,
|
||||||
|
level: this.levelTemp,
|
||||||
|
parentId: this.parentId,
|
||||||
|
archivesName:this.addFormParams.archivesName
|
||||||
|
};
|
||||||
|
const editParams = {
|
||||||
|
infoId: this.idTemp,
|
||||||
|
parentId: this.parentId,
|
||||||
|
archivesName:this.addFormParams.archivesName
|
||||||
|
};
|
||||||
|
|
||||||
|
const addDetailsParam = {
|
||||||
|
infoId:this.queryParams.infoId,
|
||||||
|
detailsId:this.queryParams.detailsId,
|
||||||
|
level:this.queryParams.level,
|
||||||
|
docName:this.addFormParams.archivesName
|
||||||
|
};
|
||||||
|
this.$refs["addFormParamsRef"].validate(async (valid) => {
|
||||||
|
if (valid) {
|
||||||
|
if(this.addTitle === "新建类别"){ //左侧树tree-新建类别
|
||||||
|
const res = await getAddArchivesTypeApi({archivesName:this.addFormParams.archivesName});
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.$message.success("新建成功!");
|
||||||
|
this.addShowVisible = false;
|
||||||
|
this.getTreeData();
|
||||||
|
}
|
||||||
|
}else if (this.addTitle === "新增") {//左侧树tree-新增类别
|
||||||
|
const res = await getAddArchivesTypeApi(addParams);
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.$message.success("新增成功!");
|
||||||
|
this.addShowVisible = false;
|
||||||
|
this.getTreeData();
|
||||||
|
}
|
||||||
|
}else if (this.addTitle === "新建文件夹") {//右侧table-新建文件夹
|
||||||
|
const res = await addArchivesDetailsApi({"archivesDetails":addDetailsParam});
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.$message.success("新建成功!");
|
||||||
|
this.addShowVisible = false;
|
||||||
|
this.getList();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const res = await updateArchivesTypeApi(editParams);
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.$message.success("修改成功!");
|
||||||
|
this.addShowVisible = false;
|
||||||
|
this.getTreeData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/* 取消 */
|
||||||
|
onCancel() {
|
||||||
|
this.addShowVisible = false;
|
||||||
|
},
|
||||||
|
// 筛选节点 - 左侧树
|
||||||
|
filterNode(value, data) {
|
||||||
|
if (!value) return true;
|
||||||
|
return data.label.indexOf(value) !== -1;
|
||||||
|
},
|
||||||
|
/** 查询列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
getArchivesDetailsLstApi(this.queryParams).then((response) => {
|
||||||
|
this.tableDataList = response.data.rows;
|
||||||
|
this.total = response.data.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 文件夹单击事件 - 右侧
|
||||||
|
getSubDetails(row){
|
||||||
|
if(row.docType=='文件夹'){
|
||||||
|
this.queryParams.detailsId=row.detailsId;
|
||||||
|
this.queryParams.level=row.level;
|
||||||
|
this.queryParams.infoId="";
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
let obj = {
|
||||||
|
id:row.detailsId,
|
||||||
|
detailsId:row.detailsId,
|
||||||
|
level:row.level,
|
||||||
|
docName:row.docName,
|
||||||
|
}
|
||||||
|
this.breadcrumbList.push(obj)
|
||||||
|
this.getList()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 节点单击事件 - 左侧树
|
||||||
|
handleNodeClick(data, node) {
|
||||||
|
console.log(data)
|
||||||
|
if (data.level != 1) {
|
||||||
|
this.queryParams.infoId = data.id;
|
||||||
|
this.queryParams.detailsId=""
|
||||||
|
this.queryParams.level=""
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.breadcrumbList=[]
|
||||||
|
let obj = {
|
||||||
|
id:0,
|
||||||
|
infoId:data.id,
|
||||||
|
detailsId:'',
|
||||||
|
level:'',
|
||||||
|
docName:data.label
|
||||||
|
}
|
||||||
|
this.breadcrumbList.push(obj)
|
||||||
|
this.getList();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 面包屑单击事件-右侧
|
||||||
|
breadClick(item,index){
|
||||||
|
console.log(item)
|
||||||
|
console.log(index)
|
||||||
|
if(item.detailsId!=''){
|
||||||
|
this.queryParams.detailsId=item.detailsId;
|
||||||
|
this.queryParams.level=item.level;
|
||||||
|
this.queryParams.infoId="";
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.$set(this, 'breadcrumbList', this.breadcrumbList.slice(0,index+1));
|
||||||
|
this.getList()
|
||||||
|
}else{
|
||||||
|
this.queryParams.detailsId="";
|
||||||
|
this.queryParams.level="";
|
||||||
|
this.queryParams.infoId=item.infoId;
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.$set(this, 'breadcrumbList', this.breadcrumbList.slice(0,index+1));
|
||||||
|
this.getList()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//新建文件夹按钮
|
||||||
|
handleAdd(){
|
||||||
|
this.addTitle = "新建文件夹";
|
||||||
|
this.addFormParams.archivesName="";
|
||||||
|
this.addShowVisible = true;
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.queryParams.infoId = undefined;
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.queryParams.pageSize = 10;
|
||||||
|
// this.queryParams.level = 0;
|
||||||
|
this.$refs.tree.setCurrentKey(null);
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map((item) => item);
|
||||||
|
this.single = selection.length != 1;
|
||||||
|
this.multiple = !selection.length;
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = { parentId: ""};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
//查看
|
||||||
|
handleView(row) {
|
||||||
|
console.log(row)
|
||||||
|
},
|
||||||
|
handleReName(){
|
||||||
|
this.handleUpdate(this.ids[0])
|
||||||
|
},
|
||||||
|
/** 重命名按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
console.log(row)
|
||||||
|
this.rowData=row
|
||||||
|
this.reNameForm.oldName=row.docName;
|
||||||
|
this.reNameForm.newName="";
|
||||||
|
this.reNameShowVisible=true;
|
||||||
|
},
|
||||||
|
/** 重命名弹窗保存 */
|
||||||
|
saveName(){
|
||||||
|
let param = {
|
||||||
|
detailsId:this.rowData.detailsId,
|
||||||
|
infoId:this.rowData.detailsId,
|
||||||
|
docName:this.reNameForm.newName
|
||||||
|
}
|
||||||
|
this.$refs["reNameForm"].validate(async (valid) => {
|
||||||
|
if (valid) {
|
||||||
|
const res = await updateArchivesDetailsApi(param);
|
||||||
|
if (res.code === 200) {
|
||||||
|
this.$message.success("修改成功!");
|
||||||
|
this.reNameShowVisible = false;
|
||||||
|
this.getList()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
let archivesDetailsList=[
|
||||||
|
{detailsId:row.detailsId}
|
||||||
|
]
|
||||||
|
this.$modal
|
||||||
|
.confirm("是否确认删除数据项?")
|
||||||
|
.then(function () {
|
||||||
|
return delArchivesDetailsApi({'archivesDetailsList':archivesDetailsList});
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
this.getList();
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
//多选删除
|
||||||
|
handleAllDel(){
|
||||||
|
let arr=[]
|
||||||
|
this.ids.forEach(item=>{
|
||||||
|
arr.push({detailsId:item.detailsId})
|
||||||
|
})
|
||||||
|
this.$modal
|
||||||
|
.confirm("是否确认删除数据项?")
|
||||||
|
.then(function () {
|
||||||
|
return delArchivesDetailsApi({'archivesDetailsList':arr});
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
this.getList();
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
/** 导出按钮作 */
|
||||||
|
handleExport() {
|
||||||
|
// let queryTemp = this.queryParams;
|
||||||
|
// // queryTemp.level = 0;
|
||||||
|
// this.download(
|
||||||
|
// "/material/ma_type/export",
|
||||||
|
// {
|
||||||
|
// ...queryTemp,
|
||||||
|
// },
|
||||||
|
// `物资类型信息_${new Date().getTime()}.xlsx`
|
||||||
|
// );
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue