马宇豪
2024-03-01 80ca454691ea7240c03cba5b3826ac182166d3b0
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>
@@ -70,6 +70,12 @@
            icon="el-icon-edit"
            @click="openCert(scope.row,'view')"
          >查看</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="openSupplementary(scope.row,'view')"
          >证书补档</el-button>
        </template>
      </el-table-column>
    </el-table>
@@ -81,11 +87,21 @@
      @pagination="getPage"
    />
    <certificate-dialog ref="certificate" @getList="getPage"></certificate-dialog>
    <el-dialog title="证书补档" :visible.sync="supplementaryVisible" width="50%" append-to-body>
      <div style="display: flex;flex-direction: column;align-items: center">
        <el-image
          style="width: 100px; height: 100px"
          :src="print"
          fit="contain"></el-image>
        <p style="font-size: 16px">请使用专业打印机连接</p>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import { getCertificatePage } from "@/api/notCoalMine/certifiate";
import {getCertificatePage, getCertificateSync} from "@/api/notCoalMine/certifiate";
import printImg from '@/assets/images/print.png'
import certificateDialog from "@/views/notCoalMine/nCertificateList/components/certificateDialog";
export default {
  name: "nCertificateManage",
@@ -95,6 +111,7 @@
    return {
      loading: false,
      showSearch: true,
      supplementaryVisible: false,
      total: 0,
      dataList: [],
      queryParams: {
@@ -103,13 +120,38 @@
        idcardTypeCode: '',
        pageNum: 1,
        pageSize: 10
      }
      },
      print: printImg
    };
  },
  created() {
    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
@@ -149,6 +191,9 @@
    },
    openCert(data,type){
      this.$refs.certificate.openDialog(data,type)
    },
    openSupplementary(data,type){
      this.supplementaryVisible = true
    }
  }
};