作者 张晓杰

新增证照管理

  1 +import request from '@/utils/request'
  2 +
  3 +// 查询单位证照表列表
  4 +export function listOrginfoCertificate(query) {
  5 + return request({
  6 + url: '/compliancemanagement/orginfoCertificate/list',
  7 + method: 'get',
  8 + params: query
  9 + })
  10 +}
  11 +
  12 +// 查询单位证照表详细
  13 +export function getOrginfoCertificate(id) {
  14 + return request({
  15 + url: '/compliancemanagement/orginfoCertificate/' + id,
  16 + method: 'get'
  17 + })
  18 +}
  19 +
  20 +// 新增单位证照表
  21 +export function addOrginfoCertificate(data) {
  22 + return request({
  23 + url: '/compliancemanagement/orginfoCertificate',
  24 + method: 'post',
  25 + data: data
  26 + })
  27 +}
  28 +
  29 +// 修改单位证照表
  30 +export function updateOrginfoCertificate(data) {
  31 + return request({
  32 + url: '/compliancemanagement/orginfoCertificate',
  33 + method: 'put',
  34 + data: data
  35 + })
  36 +}
  37 +
  38 +// 删除单位证照表
  39 +export function delOrginfoCertificate(id) {
  40 + return request({
  41 + url: '/compliancemanagement/orginfoCertificate/' + id,
  42 + method: 'delete'
  43 + })
  44 +}
@@ -100,7 +100,21 @@ export const constantRoutes = [ @@ -100,7 +100,21 @@ export const constantRoutes = [
100 meta: { title: '个人中心', icon: 'user' } 100 meta: { title: '个人中心', icon: 'user' }
101 } 101 }
102 ] 102 ]
  103 + },
  104 + {
  105 + path: '/contract/compliancemanagement',
  106 + component: Layout,
  107 + hidden: true,
  108 + children: [
  109 + {
  110 + path: 'orginfoCertificate/index',
  111 + component: () => import('@/views/compliancemanagement/orginfoCertificate/index'),
  112 + name: 'orginfoCertificate',
  113 + meta: { title: '证照管理', icon: '' }
  114 + }
  115 + ]
103 } 116 }
  117 + /contract/compliancemanagement/orginfoCertificate
104 ] 118 ]
105 119
106 // 动态路由,基于用户权限动态去加载 120 // 动态路由,基于用户权限动态去加载
  1 +<template>
  2 + <div class="app-container">
  3 + <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
  4 + <el-form-item label="单位编号" prop="orgcode">
  5 + <el-input
  6 + v-model="queryParams.orgcode"
  7 + placeholder="请输入单位编号"
  8 + clearable
  9 + @keyup.enter.native="handleQuery"
  10 + />
  11 + </el-form-item>
  12 + <el-form-item label="证书编号" prop="certificateNo">
  13 + <el-input
  14 + v-model="queryParams.certificateNo"
  15 + placeholder="请输入证书编号"
  16 + clearable
  17 + @keyup.enter.native="handleQuery"
  18 + />
  19 + </el-form-item>
  20 + <el-form-item label="认证机构名称" prop="certificationName">
  21 + <el-input
  22 + v-model="queryParams.certificationName"
  23 + placeholder="请输入认证机构名称"
  24 + clearable
  25 + @keyup.enter.native="handleQuery"
  26 + />
  27 + </el-form-item>
  28 + <el-form-item label="发证时间" prop="issuanceDate">
  29 + <el-date-picker clearable
  30 + v-model="queryParams.issuanceDate"
  31 + type="date"
  32 + value-format="yyyy-MM-dd"
  33 + placeholder="请选择发证时间">
  34 + </el-date-picker>
  35 + </el-form-item>
  36 + <el-form-item label="证书有效期" prop="certificateValidityPeriod">
  37 + <el-date-picker clearable
  38 + v-model="queryParams.certificateValidityPeriod"
  39 + type="date"
  40 + value-format="yyyy-MM-dd"
  41 + placeholder="请选择证书有效期">
  42 + </el-date-picker>
  43 + </el-form-item>
  44 + <el-form-item label="证书附件" prop="certificateAttachment">
  45 + <el-input
  46 + v-model="queryParams.certificateAttachment"
  47 + placeholder="请输入证书附件"
  48 + clearable
  49 + @keyup.enter.native="handleQuery"
  50 + />
  51 + </el-form-item>
  52 + <el-form-item>
  53 + <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  54 + <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  55 + </el-form-item>
  56 + </el-form>
  57 +
  58 + <el-row :gutter="10" class="mb8">
  59 + <el-col :span="1.5">
  60 + <el-button
  61 + type="primary"
  62 + plain
  63 + icon="el-icon-plus"
  64 + size="mini"
  65 + @click="handleAdd"
  66 + v-hasPermi="['compliancemanagement:orginfoCertificate:add']"
  67 + >新增</el-button>
  68 + </el-col>
  69 + <el-col :span="1.5">
  70 + <el-button
  71 + type="success"
  72 + plain
  73 + icon="el-icon-edit"
  74 + size="mini"
  75 + :disabled="single"
  76 + @click="handleUpdate"
  77 + v-hasPermi="['compliancemanagement:orginfoCertificate:edit']"
  78 + >修改</el-button>
  79 + </el-col>
  80 + <el-col :span="1.5">
  81 + <el-button
  82 + type="danger"
  83 + plain
  84 + icon="el-icon-delete"
  85 + size="mini"
  86 + :disabled="multiple"
  87 + @click="handleDelete"
  88 + v-hasPermi="['compliancemanagement:orginfoCertificate:remove']"
  89 + >删除</el-button>
  90 + </el-col>
  91 + <el-col :span="1.5">
  92 + <el-button
  93 + type="warning"
  94 + plain
  95 + icon="el-icon-download"
  96 + size="mini"
  97 + @click="handleExport"
  98 + v-hasPermi="['compliancemanagement:orginfoCertificate:export']"
  99 + >导出</el-button>
  100 + </el-col>
  101 + <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  102 + </el-row>
  103 +
  104 + <el-table v-loading="loading" :data="orginfoCertificateList" @selection-change="handleSelectionChange">
  105 + <el-table-column type="selection" width="55" align="center" />
  106 + <el-table-column label="" align="center" prop="id" v-if="true"/>
  107 + <el-table-column label="单位编号" align="center" prop="orgcode" />
  108 + <el-table-column label="证书编号" align="center" prop="certificateNo" />
  109 + <el-table-column label="认证机构名称" align="center" prop="certificationName" />
  110 + <el-table-column label="发证时间" align="center" prop="issuanceDate" width="180">
  111 + <template slot-scope="scope">
  112 + <span>{{ parseTime(scope.row.issuanceDate, '{y}-{m}-{d}') }}</span>
  113 + </template>
  114 + </el-table-column>
  115 + <el-table-column label="证书有效期" align="center" prop="certificateValidityPeriod" width="180">
  116 + <template slot-scope="scope">
  117 + <span>{{ parseTime(scope.row.certificateValidityPeriod, '{y}-{m}-{d}') }}</span>
  118 + </template>
  119 + </el-table-column>
  120 + <el-table-column label="证书附件" align="center" prop="certificateAttachment" />
  121 + <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  122 + <template slot-scope="scope">
  123 + <el-button
  124 + size="mini"
  125 + type="text"
  126 + icon="el-icon-edit"
  127 + @click="handleUpdate(scope.row)"
  128 + v-hasPermi="['compliancemanagement:orginfoCertificate:edit']"
  129 + >修改</el-button>
  130 + <el-button
  131 + size="mini"
  132 + type="text"
  133 + icon="el-icon-delete"
  134 + @click="handleDelete(scope.row)"
  135 + v-hasPermi="['compliancemanagement:orginfoCertificate:remove']"
  136 + >删除</el-button>
  137 + </template>
  138 + </el-table-column>
  139 + </el-table>
  140 +
  141 + <pagination
  142 + v-show="total>0"
  143 + :total="total"
  144 + :page.sync="queryParams.pageNum"
  145 + :limit.sync="queryParams.pageSize"
  146 + @pagination="getList"
  147 + />
  148 +
  149 + <!-- 添加或修改单位证照表对话框 -->
  150 + <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
  151 + <el-form ref="form" :model="form" :rules="rules" label-width="80px">
  152 + <el-form-item label="单位编号" prop="orgcode">
  153 + <el-input v-model="form.orgcode" placeholder="请输入单位编号" />
  154 + </el-form-item>
  155 + <el-form-item label="证书编号" prop="certificateNo">
  156 + <el-input v-model="form.certificateNo" placeholder="请输入证书编号" />
  157 + </el-form-item>
  158 + <el-form-item label="认证机构名称" prop="certificationName">
  159 + <el-input v-model="form.certificationName" placeholder="请输入认证机构名称" />
  160 + </el-form-item>
  161 + <el-form-item label="发证时间" prop="issuanceDate">
  162 + <el-date-picker clearable
  163 + v-model="form.issuanceDate"
  164 + type="datetime"
  165 + value-format="yyyy-MM-dd HH:mm:ss"
  166 + placeholder="请选择发证时间">
  167 + </el-date-picker>
  168 + </el-form-item>
  169 + <el-form-item label="证书有效期" prop="certificateValidityPeriod">
  170 + <el-date-picker clearable
  171 + v-model="form.certificateValidityPeriod"
  172 + type="datetime"
  173 + value-format="yyyy-MM-dd HH:mm:ss"
  174 + placeholder="请选择证书有效期">
  175 + </el-date-picker>
  176 + </el-form-item>
  177 + <el-form-item label="证书附件" prop="certificateAttachment">
  178 + <el-input v-model="form.certificateAttachment" placeholder="请输入证书附件" />
  179 + </el-form-item>
  180 + </el-form>
  181 + <div slot="footer" class="dialog-footer">
  182 + <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
  183 + <el-button @click="cancel">取 消</el-button>
  184 + </div>
  185 + </el-dialog>
  186 + </div>
  187 +</template>
  188 +
  189 +<script>
  190 +import { listOrginfoCertificate, getOrginfoCertificate, delOrginfoCertificate, addOrginfoCertificate, updateOrginfoCertificate } from "@/api/compliancemanagement/orginfoCertificate";
  191 +
  192 +export default {
  193 + name: "OrginfoCertificate",
  194 + data() {
  195 + return {
  196 + // 按钮loading
  197 + buttonLoading: false,
  198 + // 遮罩层
  199 + loading: true,
  200 + // 选中数组
  201 + ids: [],
  202 + // 非单个禁用
  203 + single: true,
  204 + // 非多个禁用
  205 + multiple: true,
  206 + // 显示搜索条件
  207 + showSearch: true,
  208 + // 总条数
  209 + total: 0,
  210 + // 单位证照表表格数据
  211 + orginfoCertificateList: [],
  212 + // 弹出层标题
  213 + title: "",
  214 + // 是否显示弹出层
  215 + open: false,
  216 + // 查询参数
  217 + queryParams: {
  218 + pageNum: 1,
  219 + pageSize: 10,
  220 + orgcode: undefined,
  221 + certificateNo: undefined,
  222 + certificationName: undefined,
  223 + issuanceDate: undefined,
  224 + certificateValidityPeriod: undefined,
  225 + certificateAttachment: undefined,
  226 + },
  227 + // 表单参数
  228 + form: {},
  229 + // 表单校验
  230 + rules: {
  231 + id: [
  232 + { required: true, message: "不能为空", trigger: "blur" }
  233 + ],
  234 + orgcode: [
  235 + { required: true, message: "单位编号不能为空", trigger: "blur" }
  236 + ],
  237 + certificateNo: [
  238 + { required: true, message: "证书编号不能为空", trigger: "blur" }
  239 + ],
  240 + certificationName: [
  241 + { required: true, message: "认证机构名称不能为空", trigger: "blur" }
  242 + ],
  243 + issuanceDate: [
  244 + { required: true, message: "发证时间不能为空", trigger: "blur" }
  245 + ],
  246 + certificateValidityPeriod: [
  247 + { required: true, message: "证书有效期不能为空", trigger: "blur" }
  248 + ],
  249 + certificateAttachment: [
  250 + { required: true, message: "证书附件不能为空", trigger: "blur" }
  251 + ],
  252 + }
  253 + };
  254 + },
  255 + created() {
  256 + this.getList();
  257 + },
  258 + methods: {
  259 + /** 查询单位证照表列表 */
  260 + getList() {
  261 + this.loading = true;
  262 + listOrginfoCertificate(this.queryParams).then(response => {
  263 + this.orginfoCertificateList = response.rows;
  264 + this.total = response.total;
  265 + this.loading = false;
  266 + });
  267 + },
  268 + // 取消按钮
  269 + cancel() {
  270 + this.open = false;
  271 + this.reset();
  272 + },
  273 + // 表单重置
  274 + reset() {
  275 + this.form = {
  276 + id: undefined,
  277 + orgcode: undefined,
  278 + certificateNo: undefined,
  279 + certificationName: undefined,
  280 + issuanceDate: undefined,
  281 + certificateValidityPeriod: undefined,
  282 + certificateAttachment: undefined,
  283 + createBy: undefined,
  284 + createTime: undefined,
  285 + updateBy: undefined,
  286 + updateTime: undefined
  287 + };
  288 + this.resetForm("form");
  289 + },
  290 + /** 搜索按钮操作 */
  291 + handleQuery() {
  292 + this.queryParams.pageNum = 1;
  293 + this.getList();
  294 + },
  295 + /** 重置按钮操作 */
  296 + resetQuery() {
  297 + this.resetForm("queryForm");
  298 + this.handleQuery();
  299 + },
  300 + // 多选框选中数据
  301 + handleSelectionChange(selection) {
  302 + this.ids = selection.map(item => item.id)
  303 + this.single = selection.length!==1
  304 + this.multiple = !selection.length
  305 + },
  306 + /** 新增按钮操作 */
  307 + handleAdd() {
  308 + this.reset();
  309 + this.open = true;
  310 + this.title = "添加单位证照表";
  311 + },
  312 + /** 修改按钮操作 */
  313 + handleUpdate(row) {
  314 + this.loading = true;
  315 + this.reset();
  316 + const id = row.id || this.ids
  317 + getOrginfoCertificate(id).then(response => {
  318 + this.loading = false;
  319 + this.form = response.data;
  320 + this.open = true;
  321 + this.title = "修改单位证照表";
  322 + });
  323 + },
  324 + /** 提交按钮 */
  325 + submitForm() {
  326 + this.$refs["form"].validate(valid => {
  327 + if (valid) {
  328 + this.buttonLoading = true;
  329 + if (this.form.id != null) {
  330 + updateOrginfoCertificate(this.form).then(response => {
  331 + this.$modal.msgSuccess("修改成功");
  332 + this.open = false;
  333 + this.getList();
  334 + }).finally(() => {
  335 + this.buttonLoading = false;
  336 + });
  337 + } else {
  338 + addOrginfoCertificate(this.form).then(response => {
  339 + this.$modal.msgSuccess("新增成功");
  340 + this.open = false;
  341 + this.getList();
  342 + }).finally(() => {
  343 + this.buttonLoading = false;
  344 + });
  345 + }
  346 + }
  347 + });
  348 + },
  349 + /** 删除按钮操作 */
  350 + handleDelete(row) {
  351 + const ids = row.id || this.ids;
  352 + this.$modal.confirm('是否确认删除单位证照表编号为"' + ids + '"的数据项?').then(() => {
  353 + this.loading = true;
  354 + return delOrginfoCertificate(ids);
  355 + }).then(() => {
  356 + this.loading = false;
  357 + this.getList();
  358 + this.$modal.msgSuccess("删除成功");
  359 + }).catch(() => {
  360 + }).finally(() => {
  361 + this.loading = false;
  362 + });
  363 + },
  364 + /** 导出按钮操作 */
  365 + handleExport() {
  366 + this.download('compliancemanagement/orginfoCertificate/export', {
  367 + ...this.queryParams
  368 + }, `orginfoCertificate_${new Date().getTime()}.xlsx`)
  369 + }
  370 + }
  371 +};
  372 +</script>
@@ -81,6 +81,11 @@ @@ -81,6 +81,11 @@
81 <el-button 81 <el-button
82 size="mini" 82 size="mini"
83 type="text" 83 type="text"
  84 + @click="toOrginfoCertificateList(scope.row)"
  85 + >证照管理</el-button>
  86 + <el-button
  87 + size="mini"
  88 + type="text"
84 icon="el-icon-edit" 89 icon="el-icon-edit"
85 @click="handleUpdate(scope.row)" 90 @click="handleUpdate(scope.row)"
86 v-hasPermi="['system:orginfo:edit']" 91 v-hasPermi="['system:orginfo:edit']"
@@ -192,6 +197,10 @@ export default { @@ -192,6 +197,10 @@ export default {
192 this.getList(); 197 this.getList();
193 }, 198 },
194 methods: { 199 methods: {
  200 + toOrginfoCertificateList(row){
  201 + console.log('row=====',row)
  202 + this.$router.push({ path: '/contract/compliancemanagement/orginfoCertificate', query: {orgcode: row.orgcode }});
  203 + },
195 /** 查询【请填写功能名称】列表 */ 204 /** 查询【请填写功能名称】列表 */
196 getList() { 205 getList() {
197 this.loading = true; 206 this.loading = true;
@@ -298,6 +307,7 @@ export default { @@ -298,6 +307,7 @@ export default {
298 ...this.queryParams 307 ...this.queryParams
299 }, `orginfo_${new Date().getTime()}.xlsx`) 308 }, `orginfo_${new Date().getTime()}.xlsx`)
300 } 309 }
301 - } 310 + },
  311 +
302 }; 312 };
303 </script> 313 </script>