|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div class="app-container" ref="main">
|
|
|
|
|
<div ref="search">
|
|
|
|
|
<div ref="search" class="search">
|
|
|
|
|
<el-form
|
|
|
|
|
:model="queryParams"
|
|
|
|
|
ref="queryForm"
|
|
|
|
@ -20,6 +20,13 @@
|
|
|
|
|
</el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<el-button
|
|
|
|
|
v-hasPermi="['system:certificates:add']"
|
|
|
|
|
type="primary"
|
|
|
|
|
size="small"
|
|
|
|
|
@click="handleAdd"
|
|
|
|
|
>新增</el-button
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="book-main" :style="{ height: tableHeigth + 'px' }">
|
|
|
|
@ -29,7 +36,10 @@
|
|
|
|
|
src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
|
|
|
|
|
fit="cover"
|
|
|
|
|
></el-image>
|
|
|
|
|
<div class="operate" style="font-size: 14px; color: #4d4949">
|
|
|
|
|
<div
|
|
|
|
|
class="operate"
|
|
|
|
|
style="font-size: 14px; color: #4d4949; font-weight: bold"
|
|
|
|
|
>
|
|
|
|
|
<div>高级</div>
|
|
|
|
|
<div class="right-operate">
|
|
|
|
|
<div class="operate-item">
|
|
|
|
@ -42,11 +52,18 @@
|
|
|
|
|
type="text"
|
|
|
|
|
size="mini"
|
|
|
|
|
style="color: #e6a23c; margin: 0 10px"
|
|
|
|
|
@click="handleUpdate"
|
|
|
|
|
v-hasPermi="['system:certificates:edit']"
|
|
|
|
|
>修改</el-button
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="operate-item">
|
|
|
|
|
<el-button type="text" size="mini" style="color: #f56c6c"
|
|
|
|
|
<el-button
|
|
|
|
|
v-hasPermi="['system:certificates:remove']"
|
|
|
|
|
type="text"
|
|
|
|
|
size="mini"
|
|
|
|
|
style="color: #f56c6c"
|
|
|
|
|
@click="handleDelete"
|
|
|
|
|
>删除</el-button
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
@ -61,10 +78,60 @@
|
|
|
|
|
:limit.sync="queryParams.pageSize"
|
|
|
|
|
@pagination="getList"
|
|
|
|
|
/>
|
|
|
|
|
<!-- 添加或修改证书管理对话框 -->
|
|
|
|
|
<el-dialog :visible.sync="open" width="950px" append-to-body>
|
|
|
|
|
<div slot="title" class="dialog-title">
|
|
|
|
|
<span class="title-line"></span>
|
|
|
|
|
{{ title }}
|
|
|
|
|
</div>
|
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
|
|
<el-form-item label="证书名称" prop="name">
|
|
|
|
|
<el-input v-model="form.name" placeholder="请输入证书名称" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="证书时间" prop="datetime">
|
|
|
|
|
<el-date-picker
|
|
|
|
|
clearable
|
|
|
|
|
v-model="form.datetime"
|
|
|
|
|
type="date"
|
|
|
|
|
value-format="yyyy-MM-dd"
|
|
|
|
|
placeholder="请选择证书时间"
|
|
|
|
|
>
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="服务时长" prop="serviceDuration">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="form.serviceDuration"
|
|
|
|
|
placeholder="请输入服务时长"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="证书内容">
|
|
|
|
|
<el-input
|
|
|
|
|
type="textarea"
|
|
|
|
|
:rows="3"
|
|
|
|
|
v-model="form.content"
|
|
|
|
|
placeholder="请输入证书内容"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="证书封面" prop="cover">
|
|
|
|
|
<ImageUpload :limit="1" v-model="form.cover" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
|
|
|
<el-button @click="cancel">取 消</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import {
|
|
|
|
|
listCertificates,
|
|
|
|
|
getCertificates,
|
|
|
|
|
delCertificates,
|
|
|
|
|
addCertificates,
|
|
|
|
|
updateCertificates,
|
|
|
|
|
} from "@/api/volunteer/gxhzs/gxhzsgl/index.js";
|
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
@ -77,24 +144,111 @@ export default {
|
|
|
|
|
pageNum: 0,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
},
|
|
|
|
|
form: {},
|
|
|
|
|
rules: {},
|
|
|
|
|
open: false,
|
|
|
|
|
title: "",
|
|
|
|
|
fileList: [],
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
// //给表格一个固定值
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.tableHeigth =
|
|
|
|
|
this.$refs.main.offsetHeight - this.$refs.search.offsetHeight - 100;
|
|
|
|
|
this.$refs.main.offsetHeight - this.$refs.search.offsetHeight - 80;
|
|
|
|
|
console.log(this.$refs.search.offsetHeight, "高度");
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
getList() {},
|
|
|
|
|
// 表单重置
|
|
|
|
|
reset() {
|
|
|
|
|
this.form = {
|
|
|
|
|
id: null,
|
|
|
|
|
name: null,
|
|
|
|
|
type: null,
|
|
|
|
|
cover: null,
|
|
|
|
|
content: null,
|
|
|
|
|
datetime: null,
|
|
|
|
|
serviceDuration: null,
|
|
|
|
|
createId: null,
|
|
|
|
|
createBy: null,
|
|
|
|
|
createTime: null,
|
|
|
|
|
updateId: null,
|
|
|
|
|
updateBy: null,
|
|
|
|
|
updateTime: null,
|
|
|
|
|
remark: null,
|
|
|
|
|
userId: null,
|
|
|
|
|
deptId: null,
|
|
|
|
|
};
|
|
|
|
|
this.resetForm("form");
|
|
|
|
|
},
|
|
|
|
|
// 取消按钮
|
|
|
|
|
cancel() {
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.reset();
|
|
|
|
|
},
|
|
|
|
|
/** 新增按钮操作 */
|
|
|
|
|
handleAdd() {
|
|
|
|
|
this.reset();
|
|
|
|
|
this.open = true;
|
|
|
|
|
this.title = "添加证书管理";
|
|
|
|
|
},
|
|
|
|
|
/** 修改按钮操作 */
|
|
|
|
|
handleUpdate(row) {
|
|
|
|
|
this.reset();
|
|
|
|
|
const id = row.id || this.ids;
|
|
|
|
|
getCertificates(id).then((response) => {
|
|
|
|
|
this.form = response.data;
|
|
|
|
|
this.open = true;
|
|
|
|
|
this.title = "修改证书管理";
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
/** 提交按钮 */
|
|
|
|
|
submitForm() {
|
|
|
|
|
this.$refs["form"].validate((valid) => {
|
|
|
|
|
if (valid) {
|
|
|
|
|
if (this.form.id != null) {
|
|
|
|
|
updateCertificates(this.form).then((response) => {
|
|
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
addCertificates(this.form).then((response) => {
|
|
|
|
|
this.$modal.msgSuccess("新增成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
/** 删除按钮操作 */
|
|
|
|
|
handleDelete(row) {
|
|
|
|
|
const ids = row.id || this.ids;
|
|
|
|
|
this.$modal
|
|
|
|
|
.confirm('是否确认删除证书管理编号为"' + ids + '"的数据项?')
|
|
|
|
|
.then(function () {
|
|
|
|
|
return delCertificates(ids);
|
|
|
|
|
})
|
|
|
|
|
.then(() => {
|
|
|
|
|
this.getList();
|
|
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
|
|
})
|
|
|
|
|
.catch(() => {});
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
// @import "@/assets/styles/myTable.scss";
|
|
|
|
|
// @import "@/assets/styles/element-variables.scss";
|
|
|
|
|
.search {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
}
|
|
|
|
|
::v-deep .search-container {
|
|
|
|
|
.el-form-item__content {
|
|
|
|
|
width: 550px;
|
|
|
|
@ -141,4 +295,22 @@ export default {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
::v-deep .el-dialog__header {
|
|
|
|
|
background: #f7f5f5;
|
|
|
|
|
.dialog-title {
|
|
|
|
|
font-size: 17px;
|
|
|
|
|
font-family: "Alibaba-PuHuiTi-Bold";
|
|
|
|
|
color: #4c4949;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
|
|
.title-line {
|
|
|
|
|
display: inline-block;
|
|
|
|
|
width: 5px;
|
|
|
|
|
height: 18px;
|
|
|
|
|
background: #f8414d;
|
|
|
|
|
margin-right: 6px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|