马宇豪
2023-10-13 cabf58ac1a2356a9f0296d957191fefde333f58b
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('获取文件失败')
        }
      })
    }