<template>
  <div class="main-content m20">
    <el-tabs v-model="activeName" type="border-card" style="min-height: 700px">
      <el-tab-pane label="撤销登记统计" class="caseForm" name="first">
        <div class="content-body">
          <el-table
            v-loading="loading"
            :data="cphStatistics"
            :row-class-name="tableRowClassName"
            :header-cell-style="{'text-align':'center','background':'#8cc3fb',color:'#fff'}"
            style="wdith:100%"
            :cell-style="{'text-align':'center'}"
          >
            <el-table-column prop="单位名称" label="单位名称" min-width="20%" fixed />
            <el-table-column label="业务类型">
              <el-table-column label="冒用他人身份信息登记">
                <el-table-column prop="冒用他人身份信息登记-业务办理总数" label="业务办理总数" min-width="10%" />
                <el-table-column prop="冒用他人身份信息登记-办理中业务数" label="办理中业务数" min-width="10%" />
                <el-table-column prop="冒用他人身份信息登记-办结业务数" label="办结业务数" min-width="10%" />
                <el-table-column prop="冒用他人身份信息登记-其中撤销决定业务数" label="其中撤销决定业务数" min-width="10%" />
                <el-table-column prop="冒用他人身份信息登记-终止撤销" label="终止撤销" min-width="10%" />
                <el-table-column prop="冒用他人身份信息登记-不予受理" label="不予受理" min-width="10%" />
              </el-table-column>
              <el-table-column label="冒用地址信息登记">
                <el-table-column prop="冒用地址信息登记-业务办理总数" label="业务办理总数" min-width="10%" />
                <el-table-column prop="冒用地址信息登记-办理中业务数" label="办理中业务数" min-width="10%" />
                <el-table-column prop="冒用地址信息登记-办结业务数" label="办结业务数" min-width="10%" />
                <el-table-column prop="冒用地址信息登记-其中撤销决定业务数" label="其中撤销决定业务数" min-width="10%" />
                <el-table-column prop="冒用地址信息登记-终止撤销" label="终止撤销" min-width="10%" />
                <el-table-column prop="冒用地址信息登记-不予受理" label="不予受理" min-width="10%" />
              </el-table-column>
              <el-table-column label="冒用其他信息登记">
                <el-table-column prop="冒用其他信息登记-业务办理总数" label="业务办理总数" min-width="10%" />
                <el-table-column prop="冒用其他信息登记-办理中业务数" label="办理中业务数" min-width="10%" />
                <el-table-column prop="冒用其他信息登记-办结业务数" label="办结业务数" min-width="10%" />
                <el-table-column prop="冒用其他信息登记-其中撤销决定业务数" label="其中撤销决定业务数" min-width="10%" />
                <el-table-column prop="冒用其他信息登记-终止撤销" label="终止撤销" min-width="10%" />
                <el-table-column prop="冒用其他信息登记-不予受理" label="不予受理" min-width="10%" />
              </el-table-column>
            </el-table-column>
          </el-table>
        </div>
      </el-tab-pane>
      <el-tab-pane class="tab_pane" label="撤销登记查询" name="second">
        <!--头部-查询-->
        <div class="content-header">
          <searchHeader title="查询" />
          <div class="body search-body">
            <el-row class="mb10">
              <el-col :span="12">
                <label class="label-name_1">投诉人证件号码/统一码：</label>
                <div class="search-input-box_1">
                  <el-input v-model="searchForm.paramMap.complainerCertNo" size="small" clearable type="text" class="search-input" placeholder="请输入投诉人证件号码/统一码" @keyup.enter.native="search" />
                </div>
              </el-col>
              <el-col :span="12">
                <label class="label-name_2">投诉人企业名称：</label>
                <div class="search-input-box_2">
                  <el-input v-model="searchForm.paramMap.complainerEntName" size="small" clearable type="text" class="search-input" placeholder="请输入主体名称" @keyup.enter.native="search" />
                </div>
              </el-col>
            </el-row>
            <el-row v-if="showMore" class="mb10">
              <el-col :span="12">
                <label class="label-name_2">投诉人自然人名称：</label>
                <div class="search-input-box_2">
                  <el-input v-model="searchForm.likeParamMap.complainerName" size="small" clearable type="text" class="search-input" placeholder="请输入主体名称" @keyup.enter.native="search" />
                </div>
              </el-col>
              <el-col :span="12">
                <label class="label-name_2">处理决定：</label>
                <div class="search-input-box_2">
                  <el-input v-model="searchForm.paramMap.handleResult" size="small" clearable type="text" class="search-input" placeholder="请输入处理决定" @keyup.enter.native="search" />
                </div>
              </el-col>

            </el-row>
            <el-row v-if="showMore" class="mb10">
              <el-col :span="12">
                <label class="label-name_1">处理原因：</label>
                <div class="search-input-box_1">
                  <el-select
                    v-model="searchForm.paramMap.handleRea"
                    placeholder="请选择"
                    clearable
                    style="width: 100%"
                  >
                    <el-option
                      v-for="item in handleReaList"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    />
                  </el-select>
                </div>
              </el-col>
              <el-col :span="12">
                <label class="label-name_2">作出决定机关：</label>
                <div class="search-input-box_2">
                  <el-select
                    v-model="searchForm.paramMap.judAuth"
                    placeholder="请选择"
                    clearable
                    style="width: 100%"
                  >
                    <el-option
                      v-for="item in judAuthList"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value"
                    />
                  </el-select>
                </div>
              </el-col>

            </el-row>
            <el-row v-if="showMore" class="mb10">
              <el-col :span="12">
                <label class="label-name_2">投诉日期：</label>
                <div class="search-input-box_2">
                  <el-date-picker
                    v-model="searchForm.customParamMap.createTime"
                    style="width:100%"
                    size="small"
                    type="daterange"
                    range-separator="至"
                    start-placeholder="开始日期"
                    end-placeholder="结束日期"
                    value-format="yyyy-MM-dd"
                  />
                </div>
              </el-col>
              <el-col :span="12">
                <label class="label-name_2">作出决定日期：</label>
                <div class="search-input-box_2">
                  <el-date-picker
                    v-model="searchForm.customParamMap.judDate"
                    style="width:100%"
                    size="small"
                    type="daterange"
                    range-separator="至"
                    start-placeholder="开始日期"
                    end-placeholder="结束日期"
                    value-format="yyyy-MM-dd"
                  />
                </div>
              </el-col>
            </el-row>
            <el-row>
              <el-col :span="12" :offset="1">
                <div class="btn-box">
                  <span v-if="!showMore" style="margin-right:20px;color:#1A77FF;cursor:pointer;font-size: 16px;" @click="showMoreCriteria">
                    展开<i class="el-icon-d-arrow-right" />
                  </span>
                  <span v-if="showMore" style="margin-right:20px;color:#1A77FF;cursor:pointer;font-size: 16px;" @click="showMoreCriteria">
                    <i class="el-icon-d-arrow-left" />隐藏
                  </span>
                  <el-button type="primary" size="mini" @click="search">查询</el-button>
                  <el-button size="mini" @click="resetSearchForm">重置</el-button>
                </div>
              </el-col>
            </el-row>
          </div>
        </div>
        <!--             <div style="margin: 0px 0px 20px 38px;"><el-button type="primary" size="mini" @click="toShowInsertForm">新增撤销业务</el-button></div>-->
        <!--body-查询结果-->
        <div class="content-body">
          <div class="body">
            <el-table
              ref="multipleTable"
              v-loading="loading2"
              :data="tableData"
              tooltip-effect="dark"
              class="table-style"
              :fit="true"
              :row-class-name="tableRowClassName"
              :header-cell-style="{background:'#8cc3fb',color:'#fff'}"
              @sort-change="sortChange"
            >
              <!-- <el-table-column class="no" type="selection" width="30" /> -->
              <el-table-column prop="index" label="序号" min-width="50" align="center" />
              <el-table-column prop="uniScId" label="统一社会信用代码/注册号" min-width="150" align="left" />
              <el-table-column prop="entName" :show-overflow-tooltip="true" label="主体名称" min-width="200" align="left" />
              <el-table-column prop="regItem" :show-overflow-tooltip="true" label="虚假登记事项" min-width="100" align="left" />
              <el-table-column prop="name" :show-overflow-tooltip="true" label="投诉人名称" min-width="100" align="left">
                <template slot-scope="scope">
                  {{ scope.row.complainerEntName || scope.row.complainerName }}
                </template>
              </el-table-column>
              <el-table-column prop="regTime" :show-overflow-tooltip="true" sortable="custom" label="虚假登记时间" min-width="100" align="left" />
              <el-table-column prop="createTime" :show-overflow-tooltip="true" label="投诉时间" min-width="100" align="left" />
              <el-table-column prop="judDate" :show-overflow-tooltip="true" sortable="custom" label="作出决定时间" min-width="100" align="left" />
              <el-table-column prop="judAuthCn" :show-overflow-tooltip="true" label="作出决定机关" min-width="100" align="left" />
              <el-table-column label="操作" min-width="180" align="center">
                <template slot-scope="scope">
                  <!-- <el-button type="primary" size="mini" @click="todo(scope.row)">办理</el-button> -->
                  <!-- <el-button type="primary" size="mini" @click="update(scope.row)">编辑</el-button> -->
                  <el-button type="primary" size="mini" @click="showResult(scope.row)">查看</el-button>
                </template>
              </el-table-column>
            </el-table>
            <div class="page-box">
              <el-row>
                <el-col :span="6">
                  <!-- <el-button @click="selectAll">全选</el-button>
                            <el-button @click="$util.toggleSelect($refs.multipleTable)">反选</el-button> -->
                  <!-- <el-button type="primary" size="mini" @click="toShowInsertForm">新增</el-button> -->
                </el-col>
                <el-col :span="18">
                  <el-pagination
                    :disabled="loading2"
                    :page-size="pageParam.pageSize"
                    :total="pageParam.total"
                    :page-sizes="[10, 20, 30, 40,50,100,200]"
                    layout="slot,total, sizes, prev, pager, next, jumper"
                    @size-change="pageSizeChange"
                    @current-change="pageIndexChange"
                  >
                    <span>
                      第 {{ pageParam.curPage }} 页 /
                      共 {{ (pageParam.total !== 0 ? parseInt((pageParam.total + pageParam.pageSize - 1)/pageParam.pageSize) : 1) }} 页
                    </span>
                  </el-pagination>
                </el-col>
              </el-row>
            </div>
          </div>
        </div>
      </el-tab-pane>
    </el-tabs>

  </div>
</template>

<script>
import { tFraudEntStatistics } from '@/api/comprehensive'
import searchHeader from '@/components/searchHeader'
import {
  getConstant,
  getAllDepts,
  saveOperregdec,
  getEFalperInfo,
  tFraudEntList,
  getEntBaseInfoByCode,
  startTask,
  solrListByEntName
} from '@/api/personate'
import { checkPhoneNumber, checkIdNum, uniSCID } from '@/utils/rules'
import { listAbnormalRecord } from '@/api/comprehensive'
export default {
  components: {
    searchHeader
  },
  data() {
    return {
      loading: true,
      loading2: false,
      activeName: '',
      uscc: '',
      dialogTitle: '新增', // 对话框标题
      insertForm: {
        complainerType: '',
        complainerCertType: '',
        personateid: '',
        uniScId: '',
        regno: '',
        searchCode: '',
        entname: '',
        certype: '',
        handlrea: '',
        judauth: '',
        regorgCn: '',
        noticefrom: '',
        noticeto: '',
        juddate: '',
        cerno: ''
      },
      resultForm: {},
      editable: false,
      showMore: false,
      workStart: {}, // 启动待办对象
      labelPosition: 'left',
      showInsertForm: false,
      showEntList: false,
      showAbnList: false,
      certypeList: [],
      certypeList2: [
        {
          value: '企业',
          label: '企业'
        },
        {
          value: '个体户',
          label: '个体户'
        },
        {
          value: '农合',
          label: '农合'
        }
      ],
      judAuthList: [],
      handleReaList: [],
      DeptsList: [],
      tsAbnList: [], // 经营异常名录列表
      searchForm: {
        orderField: '',
        orderingRule: '',
        paramMap: {},
        likeParamMap: {},
        customParamMap: {}
      },
      tableData: [],
      pageParam: {
        curPage: 1,
        total: 0,
        pageSize: 10
      },
      entDataList: [], // 根据名称查出的企业列表
      pageParam1: {
        curPage: 1,
        total: 0,
        pageSize: 10
      },
      formRules: {
        complainerType: [
          { required: true, message: '请选择投诉人类型' }
        ],
        complainerName: [
          { required: true, message: '请输入投诉人姓名/法定代表人/来函单位名称', trigger: 'blur' }
        ],
        complainerCertType: [
          { required: true, message: '请选择证件类型/主体类型', trigger: 'blur' }
        ],
        // contactsPhone: [
        //   { required: true, message: '请输入联系电话', trigger: 'blur' },
        //   // { validator: (rule, value, callback) => {
        //   //   checkPhoneNumber(rule, value, callback)
        //   // }, trigger: 'blur' }
        // ],
        complainerCertNo: [
          { required: true, message: '请输入证件号码/统一社会信用代码', trigger: 'blur' },
          { validator: (rule, value, callback) => {
            if (this.insertForm.complainerCertType === '1' && this.insertForm.complainerType === '0') {
              checkIdNum(rule, value, callback)
            } else if (this.insertForm.complainerType === '1') {
              uniSCID.validator(rule, value, callback)
            } else {
              callback()
            }
          }, trigger: 'blur' }
        ],
        complainerEntName: [
          { required: true, message: '请输入主体名称', trigger: 'blur' }
        ],
        complainerLegalPhone: [
          { required: true, message: '请输入法定代表人联系电话', trigger: 'blur' },
          { validator: (rule, value, callback) => {
            checkPhoneNumber(rule, value, callback)
          }, trigger: 'blur' }
        ],
        contacts: [
          { required: true, message: '请输入联系人', trigger: 'blur' }
        ],
        phoneNum: [
          { required: true, message: '请输入联系电话', trigger: 'blur' },
          { validator: (rule, value, callback) => {
            checkPhoneNumber(rule, value, callback)
          }, trigger: 'blur' }
        ],
        certype: [
          { required: true, message: '请选择证件类型', trigger: 'blur' }
        ],
        name: [
          { required: true, message: '请输入姓名', trigger: 'blur' }
        ],
        uniScId: [
          { required: true, message: '请输入统一码', trigger: 'blur' },
          uniSCID
        ]
        // regno: [
        //   { required: true, message: '请输入注册号', trigger: 'blur' }
        // ]
      },
      cphStatistics: [],
      operatestatusList: [{
        value: 'tsabnlist',
        label: '经营异常管理'
      }, {
        value: 'entlock',
        label: '联合惩戒'
      }, {
        value: 'eOtCase',
        label: '行政处罚'
      }, {
        value: 'tsserillegallist',
        label: '严重违法企'
      }, {
        value: 'eSusnateOperreg',
        label: '涉嫌冒用他人身份取得登记信息'
      }, {
        value: 'revokelist',
        label: '批量吊销'
      }]
    }
  },
  watch: {
    dialogTitle() {
      if (this.dialogTitle === '修改') {
        this.editable = true
      } else {
        this.editable = false
      }
    },
    activeName() {
      sessionStorage.setItem('activeNameStatistics', this.activeName)
    }
  },
  mounted() {
    this.searcha()
    this.insertForm.noticefrom = this.$util.getDate(0)
    this.insertForm.noticeto = this.$util.getDate(45)
    if (!sessionStorage.getItem('activeNameStatistics')) {
      this.activeName = 'first'
    } else {
      this.activeName = sessionStorage.getItem('activeNameStatistics')
    }
    // 恢复会话搜索条件
    const pageParam = sessionStorage.getItem('pageParamStatistics')
    if (pageParam) {
      this.pageParam = JSON.parse(pageParam)
      this.searchForm = this.pageParam.paramMap
      this.loadPage()
    }

    //   // 记录当前会话条件的搜索
    // sessionStorage.setItem('pageParamStatistics', JSON.stringify(this.pageParam))
    // 加载处理原因
    getConstant('CD96').then(res => {
      if (res.code === 0) {
        const list = []
        res.data.forEach(each => {
          list.push({
            value: each.code,
            label: each.name
          })
        })
        this.handleReaList = list
      }
    })
    // 加载证件类型
    getConstant('CB16').then(res => {
      if (res.code === 0) {
        const list = []
        res.data.forEach(each => {
          list.push({
            value: each.code,
            label: each.name
          })
        })
        this.certypeList = list
      }
    })

    // 加载决定机关
    getAllDepts().then(res => {
      if (res.code === 0) {
        const list = []
        res.data.forEach(each => {
          list.push({
            value: each.code,
            label: each.name
          })
        })
        this.judAuthList = list
      }
    })
  },
  methods: {
    tableRowClassName({ row, rowIndex }) {
      if (rowIndex % 2 === 1) {
        return 'warning-row'
      }
    },
    showMoreCriteria() {
      this.showMore = !this.showMore
    },
    resetSearchForm() {
      sessionStorage.removeItem('pageParamStatistics')
      this.searchForm = {
        orderField: '',
        orderingRule: '',
        paramMap: {},
        likeParamMap: {},
        customParamMap: {}
      }
    },
    openAbnList() {
      const operateStatus = {
        '0': '移出',
        '1': '列入',
        '2': '撤销',
        '3': '修改',
        '4': '标记严重失信'
      }
      this.showAbnList = true
      if (this.insertForm.pripid) {
        // 列异信息
        listAbnormalRecord(this.insertForm.pripid).then(res => {
          if (res.code === 0) {
            const data = res.data
            const list = []
            let index = 0
            data.forEach(each => {
              each.index = ++index
              each.operatestatus = operateStatus[each.operatestatus]
              list.push(each)
            })
            this.tsAbnList = list
          }
        })
      }
    },
    // 修改
    update(row) {
      this.$set(this, 'insertForm', row)
      getEFalperInfo(row.personateid).then(res => {
        if (res.code === 0) {
          this.$set(this.insertForm, 'certype', res.data.certype)
          this.$set(this.insertForm, 'cerno', res.data.cerno)
        }
      })
      this.dialogTitle = '修改'
      this.showInsertForm = !this.showInsertForm
    },
    sortChange({ column, prop, order }) {
      this.searchForm.orderField = prop
      this.searchForm.orderingRule = order === 'ascending' ? 'asc' : 'desc'
      this.search()
    },
    // 处理结果查看
    showResult(row) {
      this.$router.push({
        path: '/cancel/resultExamine',
        query: {
          bizseq: row.bizSeq,
          workflowId: row.workflowId,
          onlyShow: 'true'
        }
      })
    },
    // 仅保存
    insert() {
      this.$confirm('是否确认保存', '提示').then(() => {
        saveOperregdec(this.insertForm).then(res => {
          if (res.data === true) {
            return this.$message.success('保存成功')
          }
        })
      })
    },
    // 保存新增并创建待办
    insertAndStart() {
      this.$refs.insertForm.validate((valid, rule) => {
        if (!valid) {
          this.$message.warning(Object.values(rule)[0][0].message)
          return
        }
        let msg = ''
        this.eBAseInfo().then((status) => {
          if (status) {
            // validBeforeCreateTask(this.insertForm.pripid).then(res => {
            //   if (res.data === true) {
            //     msg = '该主体已在冒用他人身份业务流程中，是否继续开启待办'
            //   } else {
            msg = '是否确认保存并开启待办'
            //   }
            this.$confirm(msg, '提示').then(() => {
              startTask(this.insertForm).then(res => {
                if (res.code === 0) {
                  this.$message.success('保存并开启待办成功')
                  this.showInsertForm = !this.showInsertForm
                  this.$router.push({
                    path: '/cancel/cancelTodo',
                    query: {
                      tasklistid: res.data.taskId,
                      bizseq: res.data.bizSeq,
                      workflowId: res.data.workflowId
                    }
                  })
                } else {
                  this.$message.error(res.msg)
                }
              })
            })
            // })
          }
        })
      })
    },
    // 根据企业名称获取主体相关信息列表
    eBAseInfoByEntName() {
      this.loadPage1()
      this.showEntList = true
    },
    // 注册号/统一码回车获取主体相关信息
    eBAseInfo() {
      this.insertForm.searchCode = this.insertForm.uniScId || this.insertForm.regno
      return getEntBaseInfoByCode({
        code: this.insertForm.searchCode
      }).then(res => {
        if (res.code === 0) {
          this.insertForm.entname = res.data.entname
          this.insertForm.regno = res.data.regno
          this.insertForm.tel = res.data.phone || res.data.tel
          this.insertForm.lerepname = res.data.name
          this.insertForm.regorgCn = res.data.regorgCn
          this.insertForm.uniScId = res.data.uniscid
          this.insertForm.pripid = res.data.pripid
          this.insertForm.regorg = res.data.regorg
          return true
        } else {
          this.$message.error('加载主体信息失败')
          return false
        }
      })
    },
    queryComplainerCertNo() {
      getEntBaseInfoByCode({
        code: this.insertForm.complainerCertNo
      }).then(res => {
        if (res.code === 0) {
          this.$set(this.insertForm, 'complainerEntName', res.data.entname)
          if (res.data.enttype === '9910') {
            this.$set(this.insertForm, 'complainerCertType', '个体户')
          } else if (['9100', '9200'].includes(res.data.enttype)) {
            this.$set(this.insertForm, 'complainerCertType', '农合')
          } else {
            this.$set(this.insertForm, 'complainerCertType', '企业')
          }
          this.$set(this.insertForm, 'complainerName', res.data.lerep)
          this.$set(this.insertForm, 'complainerLegalPhone', res.data.phone)
          this.$set(this.insertForm, 'complainerRegOrg_cn', res.data.regorgCn)
          return true
        } else {
          this.$message.error('加载主体信息失败')
          return false
        }
      })
    },
    entDatalistClickEvent(row, column, event) {
      this.insertForm.entname = row.entname
      this.insertForm.regno = row.regno
      this.insertForm.tel = row.phone || row.tel
      this.insertForm.lerepname = row.name
      this.insertForm.regorgCn = row.acceptregorgCn
      this.insertForm.uniScId = row.uniscid
      this.insertForm.pripid = row.pripid
      this.insertForm.regorg = row.regorg
      this.showEntList = false
    },
    // 搜索
    search() {
      this.pageParam.paramMap = {
        paramMap: {},
        likeParamMap: {},
        customParamMap: {}
      }
      for (const key in this.searchForm) {
        if (typeof this.searchForm[key] === 'string') {
          this.pageParam.paramMap[key] = this.searchForm[key]
        } else {
          for (const _key in this.searchForm[key]) {
            if (this.searchForm[key][_key]) {
              if (!this.pageParam.paramMap[key]) {
                this.pageParam.paramMap[key] = {}
              }
              this.pageParam.paramMap[key][_key] = this.searchForm[key][_key]
            }
          }
        }
      }
      this.pageParam.curPage = 1
      this.loadPage()
    },
    // 当前分页改变
    pageIndexChange(curPage) {
      this.pageParam.curPage = curPage
      this.loadPage()
    },
    // 分页大小改变
    pageSizeChange(pageSize) {
      this.pageParam.pageSize = pageSize
      this.loadPage()
    },
    // 加载分页
    loadPage() {
      // 记录当前会话条件的搜索
      sessionStorage.setItem('pageParamStatistics', JSON.stringify(this.pageParam))
      if (this.loading2) return
      this.loading2 = true
      const data = JSON.parse(JSON.stringify({
        ...this.pageParam,
        ...this.pageParam.paramMap
      }))
      if (data.customParamMap.createTime) {
        data.customParamMap.createTime = data.customParamMap.createTime.join(',')
      }
      if (data.customParamMap.judDate) {
        data.customParamMap.judDate = data.customParamMap.judDate.join(',')
      }
      tFraudEntList(data).then(res => {
        this.loading2 = false
        const list = []
        let i = 1
        const pageStart = (this.pageParam.curPage - 1) * this.pageParam.pageSize
        res.data.records.forEach(each => {
          each.index = pageStart + i++
          each.uscc = each.uniScId || each.regno
          each.regno = each.regno === 'null' ? '' : each.regno
          each.tel = each.tel === 'null' ? '' : each.tel
          list.push(each)
        })
        this.tableData = list
        this.pageParam.total = res.data.total
      })
    },
    // 当前分页改变
    pageIndexChange1(curPage) {
      this.pageParam1.curPage = curPage
      this.loadPage1()
    },
    // 分页大小改变
    pageSizeChange1(pageSize) {
      this.pageParam1.pageSize = pageSize
      this.loadPage1()
    },
    // 加载分页
    loadPage1() {
      if (this.loading) return
      this.loading = true
      const data = JSON.parse(JSON.stringify({
        ...this.pageParam1,
        paramMap: {
          entName: this.insertForm.entname
        }
      }))
      solrListByEntName(data).then(res => {
        this.loading = false
        const list = []
        let i = 1
        const pageStart = (this.pageParam1.curPage - 1) * this.pageParam1.pageSize
        res.data.records.forEach(each => {
          each.index = pageStart + i++
          list.push(each)
        })
        this.entDataList = list
        this.pageParam1.total = res.data.total
      })
    },
    // 新增信息表单
    toShowInsertForm() {
      this.dialogTitle = '新增'

      const temp = {}
      for (const key in this.insertForm) {
        this.$set(temp, key, '')
        this.insertForm = temp
      }
      this.insertForm.certype = '10'
      this.showInsertForm = !this.showInsertForm
    },
    toCloseInsertForm() {
      this.showInsertForm = !this.showInsertForm
    },
    searcha() {
      this.loading = true
      tFraudEntStatistics().then(res => {
        if (res.code === 0) {
          this.cphStatistics = res.data
          // this.cphStatistics.forEach(each => {
          //   each.name = this.nameFormat(each.name)
          // })
          this.loading = false
        } else {
          this.$message.error(res.msg)
        }
      }).catch(_ => {
        this.loading = false
      })
    },
    nameFormat(code) {
      let name = ''
      this.operatestatusList.forEach(each => {
        if (each.value === code) {
          name = each.label
        }
      })
      return name
    }
  }
}
</script>
<style lang="scss" scoped>
  .main-content{
    background: #fff;
    padding: 10pt;
    .content-header{
      background: white;
      .label-name_1 {
        text-align: right;
        display: inline-block;//转成行内快，才可定义宽度
        width: 100px;
        font-size: $table-content-font-size;
      }
      .search-input-box_1{
        display: inline-block;
        width: calc(100% - 110px);
      }
      .label-name_2 {
        text-align: right;
        display: inline-block;//转成行内快，才可定义宽度
        width: 110px;
        font-size: $table-content-font-size;
      }
      .search-input-box_2{
        display: inline-block;
        width: calc(100% - 120px);
      }
      .label-name_3 {
        text-align: right;
        display: inline-block;//转成行内快，才可定义宽度
        width: 140px;
        font-size: $font-size-content-text;
      }
      .custom{
        width: calc(100% - 150px);
      }
      .search-input{
        cursor: pointer;
      }
      .body{
        padding: 20px 0;
        border-top:none;
        margin-bottom: 40PX;
      }
    }
    .content-body{
      background:white
    }
    .header{
      .title{
        font-weight: 600;
        font-size: 1.2rem;
      }
    }
    .page-box{margin:10PX;text-align:right}
    .mb10{
      margin-bottom: 10px;
    }
    .btn-box{
      display: inline-block;
      padding-left: 10px;
    }
  }
  .apply-table{
    width: 100%;
    /*margin: 0 auto;*/
    border-collapse: collapse;
    padding:15px;
    font-size:18px;
    table{
      border-top: 1px solid $color-border;
      border-left: 1px solid $color-border;
    }
    tr{
      width:100%
    }
    th,td{
      border-top: 1px solid $color-border;
      border-left: 1px solid $color-border;
      border-right: 1px solid $color-border;
      border-bottom: 1px solid $color-border;
      padding:15px
    }
    th{
      color: #5e5e5e;
      font-weight: normal;
      background: $color-form-label
    }
    td{
      text-align: center;
    }
  }
</style>
