检测文件更新
This commit is contained in:
parent
f86f41ccbe
commit
4637325572
src/views/partner
@ -8,6 +8,30 @@ export function listInspectionFile(query) {
|
|||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 根据文件id获取有权限的用户id
|
||||||
|
export function getUserIdsByFileId(query) {
|
||||||
|
return request({
|
||||||
|
url: '/inspectionFile/inspectionFile/getUserIdsByFileId',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 给文件分配权限
|
||||||
|
export function assignAuthority(data) {
|
||||||
|
return request({
|
||||||
|
url: '/inspectionFile/inspectionFile/assignAuthority',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function listStaff(query) {
|
||||||
|
return request({
|
||||||
|
url: '/inspectionStaff/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 查询inspectionFile详细
|
// 查询inspectionFile详细
|
||||||
export function getInspectionFile(id) {
|
export function getInspectionFile(id) {
|
||||||
|
@ -80,16 +80,15 @@
|
|||||||
<!-- v-hasPermi="['system:equInfo:remove']"-->
|
<!-- v-hasPermi="['system:equInfo:remove']"-->
|
||||||
<!-- >删除</el-button>-->
|
<!-- >删除</el-button>-->
|
||||||
<!-- </el-col>-->
|
<!-- </el-col>-->
|
||||||
<!-- <el-col :span="1.5">-->
|
<el-col :span="1.5">
|
||||||
<!-- <el-button-->
|
<el-button
|
||||||
<!-- type="warning"-->
|
type="warning"
|
||||||
<!-- plain-->
|
plain
|
||||||
<!-- icon="el-icon-download"-->
|
icon="el-icon-download"
|
||||||
<!-- size="mini"-->
|
size="mini"
|
||||||
<!-- @click="handleExport"-->
|
@click="handleExport"
|
||||||
<!-- v-hasPermi="['system:equInfo:export']"-->
|
>导出</el-button>
|
||||||
<!-- >导出</el-button>-->
|
</el-col>
|
||||||
<!-- </el-col>-->
|
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
|
@ -1,30 +1,30 @@
|
|||||||
<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 :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
<!-- <el-form-item label="文件名称" prop="fileName">-->
|
<el-form-item label="文件名称" prop="fileName">
|
||||||
<!-- <el-input-->
|
<el-input
|
||||||
<!-- v-model="queryParams.fileName"-->
|
v-model="queryParams.fileName"
|
||||||
<!-- placeholder="请输入文件名称"-->
|
placeholder="请输入文件名称"
|
||||||
<!-- clearable-->
|
clearable
|
||||||
<!-- @keyup.enter.native="handleQuery"-->
|
@keyup.enter.native="handleQuery"
|
||||||
<!-- />-->
|
/>
|
||||||
<!-- </el-form-item>-->
|
</el-form-item>
|
||||||
<!-- <el-form-item label="提醒时间">-->
|
<!-- <el-form-item label="提醒时间">-->
|
||||||
<!-- <el-date-picker-->
|
<!-- <el-date-picker-->
|
||||||
<!-- v-model="daterangeWarnTime"-->
|
<!-- v-model="daterangeWarnTime"-->
|
||||||
<!-- style="width: 240px"-->
|
<!-- style="width: 240px"-->
|
||||||
<!-- value-format="yyyy-MM-dd"-->
|
<!-- value-format="yyyy-MM-dd"-->
|
||||||
<!-- type="daterange"-->
|
<!-- type="daterange"-->
|
||||||
<!-- range-separator="-"-->
|
<!-- range-separator="-"-->
|
||||||
<!-- start-placeholder="开始日期"-->
|
<!-- start-placeholder="开始日期"-->
|
||||||
<!-- end-placeholder="结束日期"-->
|
<!-- end-placeholder="结束日期"-->
|
||||||
<!-- ></el-date-picker>-->
|
<!-- ></el-date-picker>-->
|
||||||
<!-- </el-form-item>-->
|
<!-- </el-form-item>-->
|
||||||
<!-- <el-form-item>-->
|
<el-form-item>
|
||||||
<!-- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</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-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="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
@ -35,7 +35,8 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
@click="handleAdd"
|
@click="handleAdd"
|
||||||
|
|
||||||
>新增</el-button>
|
>新增
|
||||||
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
@ -45,96 +46,108 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
@click="backFile()"
|
@click="backFile()"
|
||||||
|
|
||||||
>返回</el-button>
|
>返回
|
||||||
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|
||||||
<!-- <el-table v-loading="loading" :data="inspectionFileList" @selection-change="handleSelectionChange">-->
|
<!-- <el-table v-loading="loading" :data="inspectionFileList" @selection-change="handleSelectionChange">-->
|
||||||
<!-- <el-table-column type="selection" width="55" align="center" />-->
|
<!-- <el-table-column type="selection" width="55" align="center" />-->
|
||||||
<!-- <el-table-column label="" align="center" prop="id" />-->
|
<!-- <el-table-column label="" align="center" prop="id" />-->
|
||||||
<!-- <el-table-column label="类型1文件夹2文件" align="center" prop="type" />-->
|
<!-- <el-table-column label="类型1文件夹2文件" align="center" prop="type" />-->
|
||||||
<!-- <el-table-column label="文件名称" align="center" prop="fileName" />-->
|
<!-- <el-table-column label="文件名称" align="center" prop="fileName" />-->
|
||||||
<!-- <el-table-column label="文件路径" align="center" prop="filePath" />-->
|
<!-- <el-table-column label="文件路径" align="center" prop="filePath" />-->
|
||||||
<!-- <el-table-column label="提醒时间" align="center" prop="warnTime" width="180">-->
|
<!-- <el-table-column label="提醒时间" align="center" prop="warnTime" width="180">-->
|
||||||
<!-- <template slot-scope="scope">-->
|
<!-- <template slot-scope="scope">-->
|
||||||
<!-- <span>{{ parseTime(scope.row.warnTime, '{y}-{m}-{d}') }}</span>-->
|
<!-- <span>{{ parseTime(scope.row.warnTime, '{y}-{m}-{d}') }}</span>-->
|
||||||
<!-- </template>-->
|
<!-- </template>-->
|
||||||
<!-- </el-table-column>-->
|
<!-- </el-table-column>-->
|
||||||
<!-- <el-table-column label="创建时间" align="center" prop="createTime" width="180">-->
|
<!-- <el-table-column label="创建时间" align="center" prop="createTime" width="180">-->
|
||||||
<!-- <template slot-scope="scope">-->
|
<!-- <template slot-scope="scope">-->
|
||||||
<!-- <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>-->
|
<!-- <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>-->
|
||||||
<!-- </template>-->
|
<!-- </template>-->
|
||||||
<!-- </el-table-column>-->
|
<!-- </el-table-column>-->
|
||||||
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
|
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
|
||||||
<!-- <template slot-scope="scope">-->
|
<!-- <template slot-scope="scope">-->
|
||||||
<!-- <el-button-->
|
<!-- <el-button-->
|
||||||
<!-- size="mini"-->
|
<!-- size="mini"-->
|
||||||
<!-- type="text"-->
|
<!-- type="text"-->
|
||||||
<!-- icon="el-icon-edit"-->
|
<!-- icon="el-icon-edit"-->
|
||||||
<!-- @click="handleUpdate(scope.row)"-->
|
<!-- @click="handleUpdate(scope.row)"-->
|
||||||
<!-- v-hasPermi="['inspectionFile:inspectionFile:edit']"-->
|
<!-- v-hasPermi="['inspectionFile:inspectionFile:edit']"-->
|
||||||
<!-- >修改</el-button>-->
|
<!-- >修改</el-button>-->
|
||||||
<!-- <el-button-->
|
<!-- <el-button-->
|
||||||
<!-- size="mini"-->
|
<!-- size="mini"-->
|
||||||
<!-- type="text"-->
|
<!-- type="text"-->
|
||||||
<!-- icon="el-icon-delete"-->
|
<!-- icon="el-icon-delete"-->
|
||||||
<!-- @click="handleDelete(scope.row)"-->
|
<!-- @click="handleDelete(scope.row)"-->
|
||||||
<!-- v-hasPermi="['inspectionFile:inspectionFile:remove']"-->
|
<!-- v-hasPermi="['inspectionFile:inspectionFile:remove']"-->
|
||||||
<!-- >删除</el-button>-->
|
<!-- >删除</el-button>-->
|
||||||
<!-- </template>-->
|
<!-- </template>-->
|
||||||
<!-- </el-table-column>-->
|
<!-- </el-table-column>-->
|
||||||
<!-- </el-table>-->
|
<!-- </el-table>-->
|
||||||
|
|
||||||
<!-- <pagination-->
|
<!-- <pagination-->
|
||||||
<!-- v-show="total>0"-->
|
<!-- v-show="total>0"-->
|
||||||
<!-- :total="total"-->
|
<!-- :total="total"-->
|
||||||
<!-- :page.sync="queryParams.pageNum"-->
|
<!-- :page.sync="queryParams.pageNum"-->
|
||||||
<!-- :limit.sync="queryParams.pageSize"-->
|
<!-- :limit.sync="queryParams.pageSize"-->
|
||||||
<!-- @pagination="getList"-->
|
<!-- @pagination="getList"-->
|
||||||
<!-- />-->
|
<!-- />-->
|
||||||
<div class="content-box">
|
<div class="content-box">
|
||||||
|
|
||||||
<el-card class="box-card" v-for="(item,index) in inspectionFileList" :key="index" >
|
<el-card class="box-card" v-for="(item, index) in inspectionFileList" :key="index">
|
||||||
<div v-if="item.type == 1" @click="fatherji(item.id)" >
|
<div v-if="item.type == 1" @click="fatherji(item.id)">
|
||||||
<img src="../../../assets/images/wenjianjia.png" style="width: 100px;height: 100px;">
|
<img src="../../../assets/images/wenjianjia.png" style="width: 100px;height: 100px;">
|
||||||
|
<div>{{ item.fileName }}</div>
|
||||||
<div>{{item.fileName}}</div>
|
</div>
|
||||||
</div>
|
<div v-if="item.type == 2">
|
||||||
<div v-if="item.type == 2" >
|
<img src="../../../assets/images/wenjian.png" style="width: 100px;height: 100px;">
|
||||||
<img src="../../../assets/images/wenjian.png" style="width: 100px;height: 100px;">
|
<div>{{ item.fileName }}</div>
|
||||||
|
</div>
|
||||||
<div>{{item.fileName}}</div>
|
<div class="bjandshanchu">
|
||||||
</div>
|
<div class="one" @click="handleE(item)">编辑</div>
|
||||||
<div class="bjandshanchu">
|
<div class="two" v-if="item.type == '2'" @click="downloadFile(item)">下载</div>
|
||||||
<div class="one" @click="handleE(item)">编辑</div>
|
<div class="two" @click="clickStaff(item.id)">分配权限</div>
|
||||||
<div class="two" v-if="item.type =='2'" @click="downloadFile(item)" >下载</div>
|
<div class="three" @click="Deleteanniu(item.id)">删除</div>
|
||||||
<div class="three" @click="Deleteanniu(item.id)">删除</div>
|
</div>
|
||||||
|
</el-card>
|
||||||
</div>
|
|
||||||
|
|
||||||
</el-card>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<el-dialog title="分配权限" :visible.sync="isShow" width="600px" append-to-body>
|
||||||
|
<el-select v-model="selectStaffList" multiple filterable placeholder="请选择">
|
||||||
|
<el-option
|
||||||
|
v-for="item in staffList"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.nickname"
|
||||||
|
:value="item.id">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="cancelStaff">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="saveStaff">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
|
||||||
<!-- 添加或修改inspectionFile对话框 -->
|
<!-- 添加或修改inspectionFile对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||||
<!-- <el-form-item label="店铺主键" prop="partnerId">-->
|
<!-- <el-form-item label="店铺主键" prop="partnerId">-->
|
||||||
<!-- <el-input v-model="form.partnerId" placeholder="请输入店铺主键" />-->
|
<!-- <el-input v-model="form.partnerId" placeholder="请输入店铺主键" />-->
|
||||||
<!-- </el-form-item>-->
|
<!-- </el-form-item>-->
|
||||||
<!-- <el-form-item label="父节点" prop="fatherId">-->
|
<!-- <el-form-item label="父节点" prop="fatherId">-->
|
||||||
<!-- <el-input v-model="form.fatherId" placeholder="请输入父节点" />-->
|
<!-- <el-input v-model="form.fatherId" placeholder="请输入父节点" />-->
|
||||||
<!-- </el-form-item>-->
|
<!-- </el-form-item>-->
|
||||||
<el-form-item label="文件名称" prop="fileName">
|
<el-form-item label="文件名称" prop="fileName">
|
||||||
<el-input v-model="form.fileName" placeholder="请输入文件名称" />
|
<el-input v-model="form.fileName" placeholder="请输入文件名称"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="类型" prop="type" v-if="this.title ==='新增'">
|
<el-form-item label="类型" prop="type" v-if="this.title ==='新增'">
|
||||||
<el-radio-group v-model="form.type">
|
<el-radio-group v-model="form.type">
|
||||||
<el-radio :label="'1'">文件夹</el-radio>
|
<el-radio :label="'1'">文件夹</el-radio>
|
||||||
<el-radio :label="'2'">文件</el-radio>
|
<el-radio :label="'2'">文件</el-radio>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="文件路径" v-if="form.type==='2'" prop="filePath">
|
<el-form-item label="文件路径" v-if="form.type==='2'" prop="filePath">
|
||||||
<insp-file-upload
|
<insp-file-upload
|
||||||
@ -161,241 +174,314 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listInspectionFile, getInspectionFile, delInspectionFile, addInspectionFile, updateInspectionFile } from "../api/file";
|
import {
|
||||||
import inspFileUpload from '@/components/FileUpload/index.vue'
|
listInspectionFile,
|
||||||
export default {
|
getInspectionFile,
|
||||||
name: "InspectionFile",
|
delInspectionFile,
|
||||||
components:{inspFileUpload},
|
addInspectionFile,
|
||||||
data() {
|
updateInspectionFile, listStaff, assignAuthority, getUserIdsByFileId
|
||||||
return {
|
} from "../api/file";
|
||||||
// 遮罩层
|
import inspFileUpload from '@/components/FileUpload/index.vue'
|
||||||
loading: true,
|
|
||||||
// 选中数组
|
|
||||||
ids: [],
|
|
||||||
// 非单个禁用
|
|
||||||
single: true,
|
|
||||||
// 非多个禁用
|
|
||||||
multiple: true,
|
|
||||||
// 显示搜索条件
|
|
||||||
showSearch: true,
|
|
||||||
|
|
||||||
// 总条数
|
|
||||||
total: 0,
|
|
||||||
// inspectionFile表格数据
|
|
||||||
inspectionFileList: [],
|
|
||||||
// 弹出层标题
|
|
||||||
title: "",
|
|
||||||
// 是否显示弹出层
|
|
||||||
open: false,
|
|
||||||
// 提醒时间时间范围
|
|
||||||
daterangeWarnTime: [],
|
|
||||||
// 查询参数
|
|
||||||
queryParams: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
type: null,
|
|
||||||
fatherId:null,
|
|
||||||
},
|
|
||||||
fatherId:'',
|
|
||||||
oldFatherId:'',
|
|
||||||
// 表单参数
|
|
||||||
form: {},
|
|
||||||
// 表单校验
|
|
||||||
rules: {
|
|
||||||
}
|
|
||||||
};
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
backFile(){
|
|
||||||
if (this.fatherId){
|
|
||||||
getInspectionFile(this.fatherId).then(response => {
|
|
||||||
this.queryParams.fatherId = response.data.fatherId
|
|
||||||
this.fatherId = response.data.fatherId
|
|
||||||
this.queryParams.pageNum =1
|
|
||||||
this.getList()
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "InspectionFile",
|
||||||
|
components: {inspFileUpload},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// inspectionFile表格数据
|
||||||
|
inspectionFileList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 是否显示弹出层(分配权限)
|
||||||
|
isShow: false,
|
||||||
|
// 提醒时间时间范围
|
||||||
|
daterangeWarnTime: [],
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
type: null,
|
||||||
|
fatherId: null,
|
||||||
},
|
},
|
||||||
/** 查询inspectionFile列表 */
|
fatherId: '',
|
||||||
getList() {
|
oldFatherId: '',
|
||||||
this.loading = true;
|
// 表单参数
|
||||||
this.queryParams.params = {};
|
form: {},
|
||||||
if (null != this.daterangeWarnTime && '' != this.daterangeWarnTime) {123
|
// 表单校验
|
||||||
this.queryParams.params["beginWarnTime"] = this.daterangeWarnTime[0];
|
rules: {},
|
||||||
this.queryParams.params["endWarnTime"] = this.daterangeWarnTime[1];
|
// 员工列表
|
||||||
}
|
staffList: [],
|
||||||
listInspectionFile(this.queryParams).then(response => {
|
selectStaffList: [],
|
||||||
this.inspectionFileList = response.data.records;
|
fileId: ''
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
backFile() {
|
||||||
|
if (this.fatherId) {
|
||||||
|
getInspectionFile(this.fatherId).then(response => {
|
||||||
|
this.queryParams.fatherId = response.data.fatherId
|
||||||
|
this.fatherId = response.data.fatherId
|
||||||
|
this.queryParams.pageNum = 1
|
||||||
|
this.getList()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
clickStaff(fileId) {
|
||||||
|
this.fileId = fileId
|
||||||
|
this.isShow = true
|
||||||
|
this.getStaffList()
|
||||||
|
},
|
||||||
|
/** 查询inspectionFile列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
this.queryParams.params = {};
|
||||||
|
// if (null != this.daterangeWarnTime && '' != this.daterangeWarnTime) {
|
||||||
|
// 123
|
||||||
|
// this.queryParams.params["beginWarnTime"] = this.daterangeWarnTime[0];
|
||||||
|
// this.queryParams.params["endWarnTime"] = this.daterangeWarnTime[1];
|
||||||
|
// }
|
||||||
|
listInspectionFile(this.queryParams).then(response => {
|
||||||
|
this.inspectionFileList = response.data.records;
|
||||||
|
this.queryParams.fatherId = response.data.records[0].fatherId;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
getFolderList(data) {
|
||||||
|
this.loading = true;
|
||||||
|
listInspectionFile(data).then(response => {
|
||||||
|
this.inspectionFileList = response.data.records;
|
||||||
|
if (response.data.records.length > 0) {
|
||||||
this.queryParams.fatherId = response.data.records[0].fatherId;
|
this.queryParams.fatherId = response.data.records[0].fatherId;
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
}
|
||||||
},
|
});
|
||||||
fatherji(id){
|
},
|
||||||
this.oldFatherId = this.fatherId
|
fatherji(id) {
|
||||||
this.fatherId = id
|
this.fatherId = id
|
||||||
this.queryParams.fatherId = id
|
this.queryParams.fatherId = id
|
||||||
this.inspectionFileList=[]
|
this.inspectionFileList = []
|
||||||
this.queryParams.pageNum =1
|
const data = {
|
||||||
this.getList()
|
pageNum: 1,
|
||||||
},
|
pageSize: 10,
|
||||||
downloadFile(item) {
|
fatherId: id
|
||||||
// 创建一个 <a> 元素
|
|
||||||
// const link = document.createElement('a');
|
|
||||||
let href = "https://www.nuoyunr.com/minio"+item.filePath; // 文件路径
|
|
||||||
// var lastIndexOf = item.filePath.lastIndexOf(".");
|
|
||||||
// link.download = item.fileName+item.filePath.substr(lastIndexOf); // 下载的文件名
|
|
||||||
window.open(href);
|
|
||||||
// // 触发下载
|
|
||||||
// link.click();
|
|
||||||
},
|
|
||||||
// 取消按钮
|
|
||||||
cancel() {
|
|
||||||
this.open = false;
|
|
||||||
this.reset();
|
|
||||||
},
|
|
||||||
// 表单重置
|
|
||||||
reset() {
|
|
||||||
this.form = {
|
|
||||||
id: null,
|
|
||||||
partnerId: null,
|
|
||||||
type: null,
|
|
||||||
fatherId: null,
|
|
||||||
fileName: null,
|
|
||||||
filePath: null,
|
|
||||||
warnTime: null,
|
|
||||||
createTime: null,
|
|
||||||
createBy: null,
|
|
||||||
updateTime: null,
|
|
||||||
updateBy: null
|
|
||||||
};
|
|
||||||
this.resetForm("form");
|
|
||||||
},
|
|
||||||
/** 搜索按钮操作 */
|
|
||||||
handleQuery() {
|
|
||||||
this.queryParams.pageNum = 1;
|
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
/** 重置按钮操作 */
|
|
||||||
resetQuery() {
|
|
||||||
this.daterangeWarnTime = [];
|
|
||||||
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 = "新增";
|
|
||||||
},
|
|
||||||
handleE(item) {
|
|
||||||
this.reset(item);
|
|
||||||
this.form = item;
|
|
||||||
this.open = true;
|
|
||||||
this.title = "修改";
|
|
||||||
},
|
|
||||||
/** 修改按钮操作 */
|
|
||||||
handleUpdate(row) {
|
|
||||||
this.reset();
|
|
||||||
const id = row.id || this.ids
|
|
||||||
getInspectionFile(id).then(response => {
|
|
||||||
this.form = response.data;
|
|
||||||
this.open = true;
|
|
||||||
this.title = "修改inspectionFile";
|
|
||||||
});
|
|
||||||
},
|
|
||||||
/** 提交按钮 */
|
|
||||||
submitForm() {
|
|
||||||
this.$refs["form"].validate(valid => {
|
|
||||||
if (valid) {
|
|
||||||
if (this.form.id != null) {
|
|
||||||
updateInspectionFile(this.form).then(response => {
|
|
||||||
this.$modal.msgSuccess("修改成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
this.form.fatherId = this.fatherId
|
|
||||||
addInspectionFile(this.form).then(response => {
|
|
||||||
this.$modal.msgSuccess("新增成功");
|
|
||||||
this.open = false;
|
|
||||||
this.getList();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
//新建删除
|
|
||||||
Deleteanniu(id){
|
|
||||||
this.$modal.confirm('是否确认删除inspectionFile编号为"' + id + '"的数据项?').then(function() {
|
|
||||||
return delInspectionFile(id);
|
|
||||||
}).then(() => {
|
|
||||||
this.getList();
|
|
||||||
this.$modal.msgSuccess("删除成功");
|
|
||||||
}).catch(() => {});
|
|
||||||
},
|
|
||||||
/** 删除按钮操作 */
|
|
||||||
handleDelete(row) {
|
|
||||||
const ids = row.id || this.ids;
|
|
||||||
this.$modal.confirm('是否确认删除inspectionFile编号为"' + ids + '"的数据项?').then(function() {
|
|
||||||
return delInspectionFile(ids);
|
|
||||||
}).then(() => {
|
|
||||||
this.getList();
|
|
||||||
this.$modal.msgSuccess("删除成功");
|
|
||||||
}).catch(() => {});
|
|
||||||
},
|
|
||||||
/** 导出按钮操作 */
|
|
||||||
handleExport() {
|
|
||||||
this.download('inspectionFile/inspectionFile/export', {
|
|
||||||
...this.queryParams
|
|
||||||
}, `inspectionFile_${new Date().getTime()}.xlsx`)
|
|
||||||
}
|
}
|
||||||
|
this.getFolderList(data)
|
||||||
|
},
|
||||||
|
getStaffList() {
|
||||||
|
const data = {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 100000
|
||||||
|
}
|
||||||
|
listStaff(data).then(res => {
|
||||||
|
this.staffList = res.data.records
|
||||||
|
this.getUserIdsByFileId(this.fileId)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
/**根据文件id获取有权限的用户id*/
|
||||||
|
getUserIdsByFileId(fileId){
|
||||||
|
const data = {
|
||||||
|
fileId: fileId
|
||||||
|
}
|
||||||
|
getUserIdsByFileId(data).then(res => {
|
||||||
|
this.selectStaffList = res.data
|
||||||
|
})
|
||||||
|
},
|
||||||
|
downloadFile(item) {
|
||||||
|
// 创建一个 <a> 元素
|
||||||
|
// const link = document.createElement('a');
|
||||||
|
let href = "https://www.nuoyunr.com/minio" + item.filePath; // 文件路径
|
||||||
|
// var lastIndexOf = item.filePath.lastIndexOf(".");
|
||||||
|
// link.download = item.fileName+item.filePath.substr(lastIndexOf); // 下载的文件名
|
||||||
|
window.open(href);
|
||||||
|
// // 触发下载
|
||||||
|
// link.click();
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
id: null,
|
||||||
|
partnerId: null,
|
||||||
|
type: null,
|
||||||
|
fatherId: null,
|
||||||
|
fileName: null,
|
||||||
|
filePath: null,
|
||||||
|
warnTime: null,
|
||||||
|
createTime: null,
|
||||||
|
createBy: null,
|
||||||
|
updateTime: null,
|
||||||
|
updateBy: null
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.daterangeWarnTime = [];
|
||||||
|
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 = "新增";
|
||||||
|
},
|
||||||
|
handleE(item) {
|
||||||
|
this.reset(item);
|
||||||
|
this.form = item;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改";
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
const id = row.id || this.ids
|
||||||
|
getInspectionFile(id).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改inspectionFile";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.id != null) {
|
||||||
|
updateInspectionFile(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.form.fatherId = this.fatherId
|
||||||
|
addInspectionFile(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 分配文件权限给对应用户 */
|
||||||
|
saveStaff() {
|
||||||
|
console.log(this.selectStaffList, "66666666666666")
|
||||||
|
const data = {
|
||||||
|
userIds: this.selectStaffList,
|
||||||
|
fileId: this.fileId
|
||||||
|
}
|
||||||
|
assignAuthority(data).then(res => {
|
||||||
|
this.$modal.msgSuccess("分配权限成功")
|
||||||
|
})
|
||||||
|
this.selectStaffList = []
|
||||||
|
this.isShow = false
|
||||||
|
},
|
||||||
|
/** 取消按钮 */
|
||||||
|
cancelStaff() {
|
||||||
|
this.selectStaffList = []
|
||||||
|
this.isShow = false
|
||||||
|
},
|
||||||
|
//新建删除
|
||||||
|
Deleteanniu(id) {
|
||||||
|
this.$modal.confirm('是否确认删除inspectionFile编号为"' + id + '"的数据项?').then(function () {
|
||||||
|
return delInspectionFile(id);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const ids = row.id || this.ids;
|
||||||
|
this.$modal.confirm('是否确认删除inspectionFile编号为"' + ids + '"的数据项?').then(function () {
|
||||||
|
return delInspectionFile(ids);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
this.download('inspectionFile/inspectionFile/export', {
|
||||||
|
...this.queryParams
|
||||||
|
}, `inspectionFile_${new Date().getTime()}.xlsx`)
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.content-box{
|
.content-box {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
.box-card{
|
|
||||||
width: 160px;
|
|
||||||
|
|
||||||
text-align: center;
|
.box-card {
|
||||||
margin-bottom: 15px;
|
width: 160px;
|
||||||
margin-right: 15px;
|
|
||||||
}
|
text-align: center;
|
||||||
.bjandshanchu{
|
margin-bottom: 15px;
|
||||||
width: 100%;
|
margin-right: 15px;
|
||||||
display: flex;
|
}
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
.bjandshanchu {
|
||||||
}
|
width: 100%;
|
||||||
.one{
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.one {
|
||||||
color: #67C23A;
|
color: #67C23A;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
.two{
|
|
||||||
color: #409EFF;
|
.two {
|
||||||
cursor: pointer;
|
color: #409EFF;
|
||||||
}
|
cursor: pointer;
|
||||||
.three{
|
}
|
||||||
color: #F56C6C;
|
|
||||||
cursor: pointer;
|
.three {
|
||||||
}
|
color: #F56C6C;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
Reference in New Issue
Block a user