From cabf58ac1a2356a9f0296d957191fefde333f58b Mon Sep 17 00:00:00 2001 From: 马宇豪 <978517621@qq.com> Date: 星期五, 13 十月 2023 09:38:40 +0800 Subject: [PATCH] 修改 --- src/views/notCoalMine/nPeopleManage/index.vue | 25 +++++++++++++++++++++---- 1 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/views/notCoalMine/nPeopleManage/index.vue b/src/views/notCoalMine/nPeopleManage/index.vue index 0ff7c4b..65c81d8 100644 --- a/src/views/notCoalMine/nPeopleManage/index.vue +++ b/src/views/notCoalMine/nPeopleManage/index.vue @@ -44,7 +44,11 @@ {{ scope.row.sex == 0?'男':'女' }} </template> </el-table-column> - <el-table-column label="身份证号" align="center" prop="idCardNum" /> + <el-table-column label="身份证号" align="center" prop="idCardNum"> + <template #default="scope"> + {{scope.row.idCardNum | peridcardtm}} + </template> + </el-table-column> <el-table-column label="电话" align="center" prop="phone"/> <el-table-column label="民族" align="center" prop="nationCode"> <template #default="scope"> @@ -147,7 +151,7 @@ if(obj){ return obj.label }else{ - return '无' + return '未知' } }, openPeople(data,type){ @@ -161,13 +165,19 @@ this.getPage() }, resetQuery(){ - this.$refs['queryForm'].resetFields() + this.queryParams={ + idCardNum: '', + name: '', + pageNum: 1, + pageSize: 10 + } this.getPage() }, handleAdd(){ }, viewFile(file){ + const t = this axios.get(process.env.VUE_APP_BASE_API + file,{headers:{'Content-Type': 'application/json','Authorization': "Bearer " + getToken()},responseType: 'blob'}).then(res=>{ if (res) { const link = document.createElement('a') @@ -176,7 +186,14 @@ link.href = URL.createObjectURL(blob); // 创建URL window.open(link.href) } else { - this.$message.error('获取文件失败') + t.$message.error('获取文件失败') + } + }).catch(function(err){ + if(err == 'Error: Network Error'){ + t.$message.error('获取文件失败') + } + if(err == 'Error: Request failed with status code 404'){ + t.$message.error('获取文件失败') } }) } -- Gitblit v1.9.2