|
@@ -1,6 +1,13 @@
|
|
|
<template>
|
|
|
<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="contractName">
|
|
|
<el-input
|
|
|
v-model="queryParams.contractName"
|
|
@@ -9,17 +16,31 @@
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="附件业务ID" prop="fileBusinessId">
|
|
|
- <el-input
|
|
|
- v-model="queryParams.fileBusinessId"
|
|
|
- placeholder="请输入附件业务ID"
|
|
|
+ <el-form-item label="资料类别" prop="contractType">
|
|
|
+ <el-select
|
|
|
+ v-model="queryParams.contractType"
|
|
|
+ placeholder="全部"
|
|
|
clearable
|
|
|
- @keyup.enter.native="handleQuery"
|
|
|
- />
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="dict in dict.type.file_type"
|
|
|
+ :key="dict.value"
|
|
|
+ :label="dict.label"
|
|
|
+ :value="dict.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
</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>
|
|
|
|
|
@@ -32,7 +53,8 @@
|
|
|
size="mini"
|
|
|
@click="handleAdd"
|
|
|
v-hasPermi="['study:gen:add']"
|
|
|
- >新增</el-button>
|
|
|
+ >新增</el-button
|
|
|
+ >
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
@@ -43,7 +65,8 @@
|
|
|
:disabled="single"
|
|
|
@click="handleUpdate"
|
|
|
v-hasPermi="['study:gen:edit']"
|
|
|
- >修改</el-button>
|
|
|
+ >修改</el-button
|
|
|
+ >
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
@@ -54,7 +77,8 @@
|
|
|
:disabled="multiple"
|
|
|
@click="handleDelete"
|
|
|
v-hasPermi="['study:gen:remove']"
|
|
|
- >删除</el-button>
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
@@ -64,18 +88,43 @@
|
|
|
size="mini"
|
|
|
@click="handleExport"
|
|
|
v-hasPermi="['study:gen:export']"
|
|
|
- >导出</el-button>
|
|
|
+ >导出</el-button
|
|
|
+ >
|
|
|
</el-col>
|
|
|
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
+ <right-toolbar
|
|
|
+ :showSearch.sync="showSearch"
|
|
|
+ @queryTable="getList"
|
|
|
+ ></right-toolbar>
|
|
|
</el-row>
|
|
|
|
|
|
- <el-table v-loading="loading" :data="genList" @selection-change="handleSelectionChange">
|
|
|
+ <el-table
|
|
|
+ v-loading="loading"
|
|
|
+ :data="genList"
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
+ >
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
- <el-table-column label="主键ID" align="center" prop="id" />
|
|
|
+ <!-- <el-table-column label="主键ID" align="center" prop="id" /> -->
|
|
|
<el-table-column label="资料名称" align="center" prop="contractName" />
|
|
|
- <el-table-column label="资料类别" align="center" prop="contractType" />
|
|
|
- <el-table-column label="附件业务ID" align="center" prop="fileBusinessId" />
|
|
|
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
+ <el-table-column label="资料类别" align="center" prop="contractType">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <dict-tag
|
|
|
+ :options="dict.type.file_type"
|
|
|
+ :value="scope.row.contractType"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="创建人" align="center" prop="createBy" />
|
|
|
+ <el-table-column label="创建时间" align="center" prop="createTime" />
|
|
|
+ <!-- <el-table-column
|
|
|
+ label="附件业务ID"
|
|
|
+ align="center"
|
|
|
+ prop="fileBusinessId"
|
|
|
+ /> -->
|
|
|
+ <el-table-column
|
|
|
+ label="操作"
|
|
|
+ align="center"
|
|
|
+ class-name="small-padding fixed-width"
|
|
|
+ >
|
|
|
<template slot-scope="scope">
|
|
|
<el-button
|
|
|
size="mini"
|
|
@@ -83,20 +132,22 @@
|
|
|
icon="el-icon-edit"
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
v-hasPermi="['study:gen:edit']"
|
|
|
- >修改</el-button>
|
|
|
+ >修改</el-button
|
|
|
+ >
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-delete"
|
|
|
@click="handleDelete(scope.row)"
|
|
|
v-hasPermi="['study:gen:remove']"
|
|
|
- >删除</el-button>
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
-
|
|
|
+
|
|
|
<pagination
|
|
|
- v-show="total>0"
|
|
|
+ v-show="total > 0"
|
|
|
:total="total"
|
|
|
:page.sync="queryParams.pageNum"
|
|
|
:limit.sync="queryParams.pageSize"
|
|
@@ -104,19 +155,39 @@
|
|
|
/>
|
|
|
|
|
|
<!-- 添加或修改研究资料管理对话框 -->
|
|
|
- <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
+ <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
<el-form-item label="资料名称" prop="contractName">
|
|
|
<el-input v-model="form.contractName" placeholder="请输入资料名称" />
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="状态" prop="delFlag">
|
|
|
- <el-input v-model="form.delFlag" placeholder="请输入状态" />
|
|
|
+ <el-form-item label="资料类别" prop="contractType">
|
|
|
+ <el-select
|
|
|
+ v-model="form.contractType"
|
|
|
+ placeholder="请选择资料类别"
|
|
|
+ style="width: 100%"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="dict in dict.type.file_type"
|
|
|
+ :key="dict.value"
|
|
|
+ :label="dict.label"
|
|
|
+ :value="dict.value"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="附件业务ID" prop="fileBusinessId">
|
|
|
- <el-input v-model="form.fileBusinessId" placeholder="请输入附件业务ID" />
|
|
|
+ <el-form-item label="文件" prop="listFile">
|
|
|
+ <fileItem
|
|
|
+ ref="fileItems"
|
|
|
+ :id="form.id"
|
|
|
+ @getFileList="getFileList"
|
|
|
+ ></fileItem>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="备注" prop="remark">
|
|
|
- <el-input v-model="form.remark" placeholder="请输入备注" />
|
|
|
+ <el-input
|
|
|
+ rows="4"
|
|
|
+ type="textarea"
|
|
|
+ v-model="form.remark"
|
|
|
+ placeholder="请输入备注"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
@@ -130,10 +201,21 @@
|
|
|
<script>
|
|
|
import { listGen, getGen, delGen, addGen, updateGen } from "@/api/study/gen";
|
|
|
|
|
|
+import fileItem from "../../invest/components/fileItem";
|
|
|
export default {
|
|
|
name: "Gen",
|
|
|
+ components: { fileItem },
|
|
|
+ dicts: ["file_type"],
|
|
|
data() {
|
|
|
+ const validateLogo = (rule, value, callback) => {
|
|
|
+ if (this.fileList.length <= 0) {
|
|
|
+ callback(new Error("请上传文件"));
|
|
|
+ } else {
|
|
|
+ callback();
|
|
|
+ }
|
|
|
+ };
|
|
|
return {
|
|
|
+ fileList: [],
|
|
|
// 遮罩层
|
|
|
loading: true,
|
|
|
// 选中数组
|
|
@@ -161,20 +243,42 @@ export default {
|
|
|
fileBusinessId: null,
|
|
|
},
|
|
|
// 表单参数
|
|
|
- form: {},
|
|
|
+ form: {
|
|
|
+ id: null,
|
|
|
+ contractName: null,
|
|
|
+ contractType: null,
|
|
|
+ delFlag: null,
|
|
|
+ fileBusinessId: null,
|
|
|
+ remark: null,
|
|
|
+ createBy: null,
|
|
|
+ createTime: null,
|
|
|
+ updateBy: null,
|
|
|
+ updateTime: null,
|
|
|
+ listFile: null,
|
|
|
+ },
|
|
|
// 表单校验
|
|
|
rules: {
|
|
|
- }
|
|
|
+ contractName: [{ required: true, trigger: "blur", message: "请输入" }],
|
|
|
+ contractType: [
|
|
|
+ { required: true, trigger: "change", message: "请选择" },
|
|
|
+ ],
|
|
|
+ listFile: [{ required: true, validator: validateLogo }],
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 获取fileList
|
|
|
+ getFileList(fileList) {
|
|
|
+ this.fileList = fileList;
|
|
|
+ },
|
|
|
+
|
|
|
/** 查询研究资料管理列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
- listGen(this.queryParams).then(response => {
|
|
|
+ listGen(this.queryParams).then((response) => {
|
|
|
this.genList = response.rows;
|
|
|
this.total = response.total;
|
|
|
this.loading = false;
|
|
@@ -197,7 +301,8 @@ export default {
|
|
|
createBy: null,
|
|
|
createTime: null,
|
|
|
updateBy: null,
|
|
|
- updateTime: null
|
|
|
+ updateTime: null,
|
|
|
+ listFile: null,
|
|
|
};
|
|
|
this.resetForm("form");
|
|
|
},
|
|
@@ -213,38 +318,44 @@ export default {
|
|
|
},
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
|
- this.ids = selection.map(item => item.id)
|
|
|
- this.single = selection.length!==1
|
|
|
- this.multiple = !selection.length
|
|
|
+ this.ids = selection.map((item) => item.id);
|
|
|
+ this.single = selection.length !== 1;
|
|
|
+ this.multiple = !selection.length;
|
|
|
},
|
|
|
/** 新增按钮操作 */
|
|
|
handleAdd() {
|
|
|
+ let that = this;
|
|
|
this.reset();
|
|
|
this.open = true;
|
|
|
this.title = "添加研究资料管理";
|
|
|
+ setTimeout(() => {
|
|
|
+ that.$refs.fileItems.fileList = [];
|
|
|
+ }, 200);
|
|
|
},
|
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
|
this.reset();
|
|
|
- const id = row.id || this.ids
|
|
|
- getGen(id).then(response => {
|
|
|
+ const id = row.id || this.ids;
|
|
|
+ getGen(id).then((response) => {
|
|
|
this.form = response.data;
|
|
|
this.open = true;
|
|
|
this.title = "修改研究资料管理";
|
|
|
+ this.$refs.fileItems.getListFileBusinessId(id);
|
|
|
});
|
|
|
},
|
|
|
/** 提交按钮 */
|
|
|
submitForm() {
|
|
|
- this.$refs["form"].validate(valid => {
|
|
|
+ this.$refs["form"].validate((valid) => {
|
|
|
if (valid) {
|
|
|
+ this.form.listFile = this.fileList;
|
|
|
if (this.form.id != null) {
|
|
|
- updateGen(this.form).then(response => {
|
|
|
+ updateGen(this.form).then((response) => {
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
|
});
|
|
|
} else {
|
|
|
- addGen(this.form).then(response => {
|
|
|
+ addGen(this.form).then((response) => {
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
@@ -256,19 +367,27 @@ export default {
|
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|
|
|
const ids = row.id || this.ids;
|
|
|
- this.$modal.confirm('是否确认删除研究资料管理编号为"' + ids + '"的数据项?').then(function() {
|
|
|
- return delGen(ids);
|
|
|
- }).then(() => {
|
|
|
- this.getList();
|
|
|
- this.$modal.msgSuccess("删除成功");
|
|
|
- }).catch(() => {});
|
|
|
+ this.$modal
|
|
|
+ .confirm('是否确认删除研究资料管理编号为"' + ids + '"的数据项?')
|
|
|
+ .then(function () {
|
|
|
+ return delGen(ids);
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.getList();
|
|
|
+ this.$modal.msgSuccess("删除成功");
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
},
|
|
|
/** 导出按钮操作 */
|
|
|
handleExport() {
|
|
|
- this.download('study/gen/export', {
|
|
|
- ...this.queryParams
|
|
|
- }, `gen_${new Date().getTime()}.xlsx`)
|
|
|
- }
|
|
|
- }
|
|
|
+ this.download(
|
|
|
+ "study/gen/export",
|
|
|
+ {
|
|
|
+ ...this.queryParams,
|
|
|
+ },
|
|
|
+ `gen_${new Date().getTime()}.xlsx`
|
|
|
+ );
|
|
|
+ },
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|