电子档案管理
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-col :span="5" :xs="24">
|
||||
<div class="head-container">
|
||||
<div class="head-container" style="display: flex;">
|
||||
<el-input
|
||||
v-model="typeName"
|
||||
v-model="archivesName"
|
||||
placeholder="请输入关键字"
|
||||
clearable
|
||||
maxlength="50"
|
||||
|
|
@ -14,6 +14,11 @@
|
|||
prefix-icon="el-icon-search"
|
||||
style="margin-bottom: 20px"
|
||||
/>
|
||||
<el-button
|
||||
size="mini" style="margin: 0 10px;height: 32px;" type="primary"
|
||||
@click.stop="() => addTreeMainType()">
|
||||
新建分类
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="head-container" style>
|
||||
<el-tree
|
||||
|
|
@ -72,143 +77,71 @@
|
|||
</el-col>
|
||||
<!--表格数据-->
|
||||
<el-col :span="19" :xs="24">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryForm"
|
||||
size="small"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="68px"
|
||||
>
|
||||
<!-- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="关键字" prop="keyword">
|
||||
<el-input
|
||||
v-model="queryParams.keyword"
|
||||
placeholder="请输入关键字"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
|
||||
<el-input v-model="queryParams.keyword" placeholder="请输入关键字" clearable style="width: 240px" @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-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-form> -->
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
>导出
|
||||
</el-button>
|
||||
<el-row :gutter="16" style="margin-bottom: 20px;">
|
||||
<el-col :span="2">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="">上传</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport">下载</el-button>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<el-button type="warning" plain icon="el-icon-download" :disabled="single" size="mini" @click="handleReName">重命名</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>
|
||||
<right-toolbar
|
||||
:showSearch.sync="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="tableDataList"
|
||||
border
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-row :gutter="10" style="margin-bottom: 20px;">
|
||||
<el-breadcrumb separator-class="el-icon-arrow-right">
|
||||
<el-breadcrumb-item v-for="(item,index) in breadcrumbList" :key="item.id">
|
||||
<span @click="breadClick(item,index)" style="cursor: pointer;">{{item.docName}}</span>
|
||||
</el-breadcrumb-item>
|
||||
</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">
|
||||
<template slot-scope="scope">
|
||||
<span>{{(queryParams.pageNum - 1) * 10 + scope.$index + 1}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
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">
|
||||
<el-table-column label="文件名称" align="left" prop="docName" show-overflow-tooltip width="300">
|
||||
<template slot-scope="scope">
|
||||
<i v-if="scope.row.docType=='文件夹'" class="el-icon-folder-opened"></i>
|
||||
<span @click="getSubDetails(scope.row)" style="cursor: pointer;margin-left: 20px;">{{ scope.row.docName }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="" align="center" width="300">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleView(scope.row)"
|
||||
v-hasPermi="['ma:type:query']"
|
||||
>
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleView(scope.row)">
|
||||
查看
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['ma:type:edit']"
|
||||
>
|
||||
编辑
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">
|
||||
重命名
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['ma:type:remove']"
|
||||
>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</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>
|
||||
|
||||
<pagination
|
||||
|
|
@ -226,42 +159,52 @@
|
|||
<img width="100%" height="650px" :src="dialogImageUrl" alt />
|
||||
</el-dialog>
|
||||
|
||||
<!-- 新增弹框 -->
|
||||
<el-dialog
|
||||
:title="addTitle"
|
||||
: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-dialog :title="addTitle" :visible.sync="addShowVisible" v-if="addShowVisible" width="500px" append-to-body :close-on-click-modal="false">
|
||||
<el-form label-width="80px" :model="addFormParams" :rules="addFormParamsRules" ref="addFormParamsRef">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="12" v-if="addTitle === '新增'">
|
||||
<el-col :span="24" v-if="addTitle === '新增'">
|
||||
<el-form-item label="所属上级">
|
||||
<el-input
|
||||
style="width: 100%"
|
||||
disabled
|
||||
v-model="addFormParams.label"
|
||||
/>
|
||||
<el-input style="width: 100%" disabled v-model="addFormParams.label"/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="名称" prop="archivesName">
|
||||
<el-input style="width: 100%" v-model="addFormParams.archivesName" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="名称" prop="typeName">
|
||||
<el-input style="width: 100%" v-model="addFormParams.typeName" />
|
||||
</el-row>
|
||||
<el-row style="text-align: right">
|
||||
<el-form-item>
|
||||
<el-button size="small" type="primary" style="color: #fff;" @click="onSubmit">保 存</el-button>
|
||||
<el-button size="small" @click="onCancel">取 消</el-button>
|
||||
</el-form-item>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</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="onSubmit">确 定</el-button>
|
||||
<el-button size="small" @click="onCancel">取 消</el-button>
|
||||
<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>
|
||||
|
|
@ -271,18 +214,14 @@
|
|||
|
||||
<script>
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
import {
|
||||
getMaTypeList,
|
||||
getListByMaType,
|
||||
getMaType,
|
||||
queryKeeperDataApi,
|
||||
delMaType,
|
||||
addMaType,
|
||||
updateMaType,
|
||||
} from "@/api/ma/base";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
import {
|
||||
getArchivesTypeListApi,getAddArchivesTypeApi,updateArchivesTypeApi,delArchivesTypeApi,
|
||||
getArchivesDetailsLstApi, addArchivesDetailsApi, updateArchivesDetailsApi, delArchivesDetailsApi
|
||||
} from "@/api/archives/archives";
|
||||
import { imgUpLoad } from "@/api/system/upload";
|
||||
|
||||
|
||||
export default {
|
||||
name: "ToolsType",
|
||||
components: { Treeselect },
|
||||
|
|
@ -306,7 +245,7 @@ export default {
|
|||
KeeperOptions: [],//选择库管员数据
|
||||
repairerOptions: [],//维修员用户数据
|
||||
// 类型名称
|
||||
typeName: undefined,
|
||||
archivesName: undefined,
|
||||
// 左侧树-树选项
|
||||
treeOptions: undefined,
|
||||
treeTemp: [],
|
||||
|
|
@ -330,9 +269,7 @@ export default {
|
|||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
typeName: undefined,
|
||||
level: 0,
|
||||
pageSize: 10
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
|
|
@ -351,12 +288,12 @@ export default {
|
|||
addShowVisible: false,
|
||||
addTitle: "", // 新增弹框标题
|
||||
addFormParams: {
|
||||
label: "",
|
||||
typeName: "",
|
||||
companyId: 101,
|
||||
infoId: "",
|
||||
level: "",
|
||||
archivesName: ""
|
||||
},
|
||||
addFormParamsRules: {
|
||||
typeName: [
|
||||
archivesName: [
|
||||
{
|
||||
required: true,
|
||||
message: "名称不能为空",
|
||||
|
|
@ -364,12 +301,30 @@ export default {
|
|||
},
|
||||
],
|
||||
},
|
||||
isMousemoveId: null,
|
||||
isMousemoveId: null,
|
||||
breadcrumbList:[],//面包屑导航数组
|
||||
rowData:{},
|
||||
reNameShowVisible: false,
|
||||
reNameForm:{
|
||||
oldName:"",
|
||||
newName:""
|
||||
},
|
||||
reNameFormRules: {
|
||||
newName: [
|
||||
{
|
||||
required: true,
|
||||
message: "名称不能为空",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
// 根据名称筛选部门树
|
||||
typeName(val) {
|
||||
archivesName(val) {
|
||||
this.$refs.tree.filter(val);
|
||||
},
|
||||
},
|
||||
|
|
@ -379,227 +334,31 @@ export default {
|
|||
methods: {
|
||||
/** 查询新增页面-上级类型下拉树结构 */
|
||||
getTreeData() {
|
||||
getMaTypeList().then((response) => {
|
||||
getArchivesTypeListApi().then((response) => {
|
||||
this.treeOptions = response.data;
|
||||
console.log(this.treeOptions)
|
||||
if (this.treeOptions.length > 0 ){
|
||||
if(this.treeOptions[0].children&&this.treeOptions[0].children.length > 0) {
|
||||
const firstNode = this.treeOptions[0].children[0];
|
||||
this.queryParams.typeId = firstNode.id;
|
||||
this.queryParams.level = 1;
|
||||
this.queryParams.houseId = firstNode.houseId;
|
||||
this.getList();
|
||||
}else{
|
||||
this.queryParams.typeId = this.treeOptions[0].id;
|
||||
this.queryParams.level = 0;
|
||||
this.queryParams.houseId = this.treeOptions[0].id;
|
||||
this.queryParams.infoId = firstNode.id;
|
||||
let obj = {
|
||||
id:0,
|
||||
infoId:firstNode.id,
|
||||
detailsId:'',
|
||||
level:'',
|
||||
docName:firstNode.label
|
||||
}
|
||||
this.breadcrumbList.push(obj)
|
||||
this.getList();
|
||||
}
|
||||
// else{
|
||||
// this.queryParams.typeId = this.treeOptions[0].id;
|
||||
// this.queryParams.level = 0;
|
||||
// this.getList();
|
||||
// }
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 查询列表 */
|
||||
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.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) {
|
||||
try {
|
||||
|
|
@ -620,7 +379,304 @@ export default {
|
|||
},
|
||||
onMouseleave() {
|
||||
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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue