马宇豪
2023-10-07 aff4ce9ab81be8709efe4ebf1bc0383872aea205
src/views/notCoalMine/nCertificateList/index.vue
@@ -30,7 +30,7 @@
          plain
          icon="el-icon-refresh"
          size="mini"
          @click="resetQuery"
          @click="getAsyncData"
          v-hasPermi="['system:experts:add']"
        >同步数据</el-button>
      </el-col>
@@ -85,7 +85,7 @@
</template>
<script>
import { getCertificatePage } from "@/api/notCoalMine/certifiate";
import {getCertificatePage, getCertificateSync} from "@/api/notCoalMine/certifiate";
import certificateDialog from "@/views/notCoalMine/nCertificateList/components/certificateDialog";
export default {
  name: "nCertificateManage",
@@ -110,6 +110,30 @@
    this.getPage()
  },
  methods: {
    async getAsyncData(){
      const t = this
      t.loading = true
      if(t.queryParams.idcardNum !== ''){
        t.queryParams.idcardTypeCode = '01'
        const {pageNum,pageSize,...data} = t.queryParams
        const res = await getCertificateSync(data)
        if(res.code == 200){
          await t.getPage()
        }else{
          t.$message({
            message: res.msg,
            type: 'warning'
          })
        }
      }else{
        t.$message({
          message: '请输入身份证号',
          type: 'warning'
        })
      }
      t.loading = false
    },
    async getPage(){
      const t = this
      t.loading = true