Files
foton-laws-system-front/src/pages/localTool/standardRecognition/index.vue
T
2022-01-06 16:47:45 +08:00

1423 lines
56 KiB
Vue

<!--标准内容自动识别-->
<template>
<div class="standardRecognition">
<div class="action-bar">
<div slot="left">
<!-- <el-button type="primary" @click="changeData">转化</Button>-->
<el-button size="mini" @click="uploadPdf" v-btn-permission="'f56e5f765a93c14cba88f8c3270388c6'"
><i class="iconfont">&#xe65d;</i>上传</el-button
>
<el-button size="mini" @click="delData" v-btn-permission="'ef6262d0bf66a25633e903d76a93e579'"
><i class="iconfont">&#xe61b;</i>删除</el-button
>
<el-button size="mini" @click="editOcrRecord" v-btn-permission="'ef6262d0bf66a25633e903d76a93e579'"
><i class="iconfont">&#xe611;</i>编辑</el-button
>
</div>
</div>
<div class="content">
<div style="position: absolute; height: 100%; width: calc(100% - 20px)">
<el-table
border
:data="standRecoList"
style="width: 100%"
height="100%"
@selection-change="standSelectChange"
@sort-change="sortChange"
:header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }"
>
<el-table-column type="selection" align="center" width="50">
</el-table-column>
<el-table-column
prop="name"
:label="this.$t('m.serialNumber')"
type="index"
width="50"
align="center"
>
</el-table-column>
<el-table-column
prop="fileType"
:label="this.$t('m.dataType')"
align="center"
width="150"
>
<template slot-scope="scope">
{{
scope.row.fileType === "1"
? "国内标准法规"
: scope.row.fileType === "2"
? "海外标准法规"
: scope.row.fileType === "3"
? "政策"
: scope.row.fileType === "4"
? "企业标准"
: "标准"
}}
<!-- {{ scope.row.fileType === '标准' }}-->
</template>
</el-table-column>
<el-table-column
prop="standNumber"
:label="this.$t('m.standardNumberAndPolicyNumber')"
align="center"
>
</el-table-column>
<el-table-column
prop="standName"
:label="this.$t('m.standardNameAndPolicyName')"
align="center"
>
</el-table-column>
<el-table-column :label="this.$t('m.textState')" width="150" align="center" prop="fileType">
<!-- <template slot-scope="scope">-->
<!-- {{-->
<!-- scope.row.fileType === "STAND_FILE"-->
<!-- ? "标准文本"-->
<!-- : scope.row.fileType === "DRAFT_FILE"-->
<!-- ? "草案"-->
<!-- : scope.row.fileType === "OPINION_FILE"-->
<!-- ? "征求意见稿"-->
<!-- : scope.row.fileType === "SENT_SCREEN_FILE"-->
<!-- ? "送审稿"-->
<!-- : scope.row.fileType === "APPROVAL_FILE"-->
<!-- ? "报批稿"-->
<!-- : "关联文件"-->
<!-- }}-->
<!-- </template>-->
</el-table-column>
<el-table-column
prop="resultContent"
:label="this.$t('m.conversionResults')"
align="center"
width="120"
>
<template slot-scope="scope">
<el-tag :type="scope.row.resultContent === '转换成功' ? 'success' : (scope.row.resultContent === '转换中' ? undefined : 'danger')" size="small">{{ scope.row.resultContent }}</el-tag>
</template>
</el-table-column>
<el-table-column
prop="spendTime"
label="消耗时间(秒)"
align="center"
sortable="custom"
width="140"
>
</el-table-column>
<el-table-column label="操作" align="center" width="150" >
<template slot-scope="scope">
<div @click.stop style="display: inline-block">
<el-button
:disabled="scope.row.resultContent === '转换中'"
v-btn-permission="'018cb58e72025fc43a9bfe1bde00c14a'"
type="primary"
size="mini"
class="common-button-primary"
@click="downloadFile(scope.row)"
>获取文件</el-button>
</div>
</template>
</el-table-column>
</el-table>
</div>
</div>
<loading :loading="loading">正在获取中……</loading>
<pagination
:total="total"
:pageChange="page"
:pageSizeChange="pageSize"
@pageChange="pageChange"
@pageSizeChange="pageSizeChange"
></pagination>
<el-dialog
:visible.sync="uploadModal"
:title="title"
:label-width="100"
width="525px"
:before-close="cancel"
>
<el-form
:model="uploadFilesdfEo"
class="label-input-form"
ref="uploadFilesdfEo"
:rules="upFileRules"
>
<el-form-item label="文件" label-width="145px" prop="fileName">
<el-upload
:limit="1"
:on-exceed="uploadNum"
show-upload-list
:show-file-list="showUploadlist"
:on-success="uploadSuccess"
:on-remove="removeOneFile"
:action="uploadPath"
:default-file-list="defaultFileList"
:format="['pdf', 'PDF']"
:before-upload="beforeUpload"
name="file"
ref="importFileAboutStand"
>
<el-button
v-if="uploadFilesdfEo.fileName === ''"
type="primary"
size="mini"
class="common-button-primary"
>{{ $t("m.upload")+' PDF'}}</el-button>
<div v-else>
<el-input readonly v-model="uploadFilesdfEo.fileName" class="bead-input" style="width: 62%;margin-right: 14px"></el-input>
<el-button
type="primary"
size="mini"
class="common-button-primary"
>{{ $t("m.upload")+' PDF'}}</el-button>
</div>
</el-upload>
</el-form-item>
<el-form-item
label="标准号/政策号"
prop="standNumber"
label-width="145px"
>
<el-input
class="bead-input"
v-model="uploadFilesdfEo.standNumber"
:placeholder="$t('m.pleaseEnterTheStandardNumberAndPolicyNumber')"
></el-input>
<el-button type="primary" size="mini" @click="handleSelect">手动查找</el-button>
</el-form-item>
<el-form-item
label="标准名称/政策名称"
prop="standName"
label-width="145px"
>
<el-input
class="bead-input"
v-model="uploadFilesdfEo.standName"
:placeholder="$t('m.pleaseEnterTheStandardNameAndPolicyName')"
></el-input>
</el-form-item>
<el-form-item label="文本状态" prop="fileType" label-width="145px">
<el-select class="bead-input" v-model="uploadFilesdfEo.fileType">
<el-option
v-for="item in options"
:key="item.id"
:label="item.attrName"
:value="item.attrName"
>
</el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer">
<el-button size="mini" @click="cancel" icon="el-icon-close"
>取消</el-button
>
<el-button
size="mini"
icon="el-icon-check"
class="common-button-primary add-button"
@click="uploadSave"
type="primary"
:loading="isSubmit"
>{{ btnName }}</el-button
>
<!--<el-button @click="uploadSave" type="primary">转换</Button>-->
</div>
</el-dialog>
<el-drawer
title="查询结果"
:wrapperClosable="false"
:visible.sync="selectModal"
size="1250px"
:styles="styles"
:close="cancelSelectModel">
<div class="demo-drawer-content">
<el-form
class="label-input-form"
style="margin-top: 15px;"
label-width="130px"
:modal="handleSelectForm"
:inline="true"
>
<el-form-item label="标准/政策来源" class="search-item">
<el-select
v-model="handleSelectForm.dataSource"
@change="dataSourceChange"
:popper-append-to-body="false"
placeholder="请选择标准/政策来源">
<el-option value="INLAND" label="国内标准库"></el-option>
<el-option value="FOREIGN" label="海外标准库"></el-option>
<el-option value="FOREIGN_LAWS" label="国内外政策库"></el-option>
<el-option value="BUSINESS_STAND" label="企业标准库"></el-option>
</el-select>
</el-form-item>
<el-form-item label="标准编号/政策编号" class="search-item">
<el-input
v-model="handleSelectForm.lawNumber"
@change="lawNumberSearch"
placeholder="根据标准编号/政策编号查找"
clearable
:maxlength="100"></el-input>
</el-form-item>
<el-form-item label="标准名称/政策名称" class="search-item">
<el-input
v-model="handleSelectForm.lawName"
@change="lawNameSearch"
placeholder="根据标准名称/政策名称查找"
clearable
:maxlength="100"></el-input>
</el-form-item>
<el-form-item class="search-item btn-box">
<el-button
type="primary"
class="common-button-primary"
size="small"
@click="searchLawBtn">
查询
</el-button>
</el-form-item>
<el-form-item class="search-item btn-box">
<el-button
class="common-button-default"
type="default"
size="small"
@click="clearLawBtn">
清空
</el-button>
</el-form-item>
</el-form>
<loading :loading="lawInfoTableLoading">数据获取中</loading>
<el-table
ref="selections"
tooltip-effect="dark"
style="width: 100%;overflow-y: auto;overflow-x: hidden;"
border
:loading="lawInfoTableLoading"
:data="lawInfoTable"
:height="300"
:header-cell-style="{background: '#e8e8e8', color: '#333333', fontSize: '16px',
fontWeight: 'bold', height: '48px'}"
@selection-change="handleSelectTableChange"
>
<el-table-column
fixed="left"
type="selection"
width="55"
align="center">
</el-table-column>
<div v-if="handleSelectForm.dataSource === 'INLAND'">
<el-table-column
label="标准号"
width="150"
>
<template slot-scope="scope">
<a v-if="scope.row.standYear && scope.row.standTextStatusShow === '废止' || scope.row.standTextStatusShow === '被代替'" class="table-jump" style="color: #F56C6C"
@click="handlePreview(scope.row)">{{ scope.row.standSortShow }} {{
scope.row.standNumber
}}-{{ scope.row.standYear }}</a>
<a v-else-if="scope.row.standYear" class="table-jump" style="color: #333333"
@click="handlePreview(scope.row)">{{ scope.row.standSortShow }} {{
scope.row.standNumber
}}-{{ scope.row.standYear }}</a>
<a v-else @click="handlePreview(scope.row)" class="table-jump" style="color: #333333">
{{ scope.row.standSortShow }}
{{ scope.row.standNumber }}</a>
</template>
</el-table-column>
<el-table-column
show-overflow-tooltip
prop="standName"
label="标准名称"
min-width="300"
>
<template slot-scope="scope">
<a v-if="scope.row.standTextStatusShow === '废止' || scope.row.standTextStatusShow === '被代替'" @click="handlePreview(scope.row)" class="table-jump" style="color: #F56C6C">{{ scope.row.standName }}</a>
<a v-else @click="handlePreview(scope.row)" style="color: #333333" class="table-jump">{{ scope.row.standName }}</a>
</template>
</el-table-column>
<el-table-column
prop="issueTime"
sortable="custom"
width="120"
label="发布日期">
<template slot-scope="scope">
<span v-if="scope.row.standTextStatusShow === '废止' || scope.row.standTextStatusShow === '被代替'" style="color: #F56C6C">{{ formatIssueDate(scope.row.issueTime) }}</span>
<span v-else>{{ formatIssueDate(scope.row.issueTime) }}</span>
</template>
</el-table-column>
<el-table-column
prop="SSRQ"
sortable="custom"
width="120"
label="实施日期">
<template slot-scope="scope">
<!-- {{ formatIssueDate(scope.row.putTime) }}-->
<span v-if="scope.row.standTextStatusShow === '废止' || scope.row.standTextStatusShow === '被代替'" style="color: #F56C6C">{{ scope.row.ssrq ? scope.row.ssrq.substring(0, 10) : '-' }}</span>
<span v-else>{{ scope.row.ssrq ? scope.row.ssrq.substring(0, 10) : '-' }}</span>
</template>
</el-table-column>
<el-table-column
prop="XCXSSRQ"
sortable="custom"
width="150"
label="新车型实施日期">
<template slot-scope="scope">
<span v-if="scope.row.standTextStatusShow === '废止' || scope.row.standTextStatusShow === '被代替'" style="color: #F56C6C">{{ scope.row.XCXSSRQ ? scope.row.XCXSSRQ.substring(0, 10) : '-' }}</span>
<span v-else>{{ scope.row.XCXSSRQ ? scope.row.XCXSSRQ.substring(0, 10) : '-' }}</span>
</template>
</el-table-column>
<el-table-column
prop="ZCCSSRQ"
sortable="custom"
width="150"
label="在产车实施日期">
<template slot-scope="scope">
<span v-if="scope.row.standTextStatusShow === '废止' || scope.row.standTextStatusShow === '被代替'" style="color: #F56C6C">{{ scope.row.ZCCSSRQ ? scope.row.ZCCSSRQ.substring(0, 10) : '-' }}</span>
<span v-else>{{ scope.row.ZCCSSRQ ? scope.row.ZCCSSRQ.substring(0, 10) : '-' }}</span>
</template>
</el-table-column>
<el-table-column
prop="textStatus"
sortable="custom"
width="110"
label="文本状态">
<!-- <template slot="header" slot-scope="scope">-->
<!-- <el-tooltip class="item" effect="dark" content="计划修订”、“修订中”均为现行有效版本;“已修订”标准的有效性根据实际实施情况判定。" placement="bottom">-->
<!-- <span>文本状态<i class="el-icon-warning-outline"></i></span>-->
<!-- </el-tooltip>-->
<!-- </template>-->
<template slot-scope="scope">
<span v-if="scope.row.standTextStatusShow === '废止' || scope.row.standTextStatusShow === '被代替'" style="color: #F56C6C">{{
scope.row.standTextStatusShow
}}</span>
<span v-else>{{ scope.row.standTextStatusShow }}</span>
</template>
</el-table-column>
</div>
<div v-if="handleSelectForm.dataSource === 'FOREIGN'">
<el-table-column
label="标准号"
width="150"
>
<template slot-scope="scope">
<a v-if="scope.row.standYear && scope.row.standTextStatusShow === '废止' || scope.row.standTextStatusShow === '被代替'" style="color: #F56C6C" class="table-jump" @click="handlePreview(scope.row)">{{
scope.row.standSortShow
}} {{ scope.row.standNumber }}-{{ scope.row.standYear }}</a>
<a v-else-if="scope.row.standYear && scope.row.standTextStatusShow === '——' " style="color: #409EFF" class="table-jump" @click="handlePreview(scope.row)">{{
scope.row.standSortShow
}} {{ scope.row.standNumber }}-{{ scope.row.standYear }}</a>
<a v-else-if="scope.row.standYear" style="color: #333333" class="table-jump" @click="handlePreview(scope.row)">{{
scope.row.standSortShow
}} {{ scope.row.standNumber }}-{{ scope.row.standYear }}</a>
<a v-else style="color: #333333" @click="handlePreview(scope.row)" class="table-jump">{{
scope.row.standSortShow
}}
{{ scope.row.standNumber }}</a>
</template>
</el-table-column>
<el-table-column
show-overflow-tooltip
prop="standName"
label="标准名称"
min-width="300"
>
<template slot-scope="scope">
<a v-if="scope.row.standTextStatusShow === '废止' || scope.row.standTextStatusShow === '被代替'" style="color: #F56C6C" @click="handlePreview(scope.row)" class="table-jump">{{
scope.row.standName
}}</a>
<a v-else-if="scope.row.standTextStatusShow === '——' " style="color: #409EFF" @click="handlePreview(scope.row)" class="table-jump">{{
scope.row.standName
}}</a>
<a v-else style="color: #333333" @click="handlePreview(scope.row)" class="table-jump">{{
scope.row.standName
}}</a>
</template>
</el-table-column>
<el-table-column
prop="issueTime"
sortable="custom"
width="120"
label="发布日期">
<template slot-scope="scope">
<div v-if="scope.row.standTextStatusShow === '废止' || scope.row.standTextStatusShow === '被代替'" style="color: #F56C6C">
{{ formatIssueDate(scope.row.issueTime) }}
</div>
<div v-else-if="scope.row.standTextStatusShow === '——' " style="color: #409EFF">
{{ formatIssueDate(scope.row.issueTime) }}
</div>
<div v-else style="color: #333333">
{{ formatIssueDate(scope.row.issueTime) }}
</div>
</template>
</el-table-column>
<el-table-column
prop="SSRQ"
sortable="custom"
width="120"
label="实施日期">
<template slot-scope="scope">
<!-- {{ formatIssueDate(scope.row.putTime) }}-->
<span v-if="scope.row.standTextStatusShow === '废止' || scope.row.standTextStatusShow === '被代替'" style="color: #F56C6C">{{
scope.row.SSRQ ? scope.row.SSRQ.substring(0, 10) : '-'
}}</span>
<span v-else-if="scope.row.standTextStatusShow === '——' " style="color: #409EFF">{{
scope.row.SSRQ ? scope.row.SSRQ.substring(0, 10) : '-'
}}</span>
<span v-else style="color: #333333">{{ scope.row.SSRQ ? scope.row.SSRQ.substring(0, 10) : '-' }}</span>
</template>
</el-table-column>
<el-table-column
prop="XCXSSRQ"
sortable="custom"
width="150"
label="新车型实施日期">
<template slot-scope="scope">
<span v-if="scope.row.standTextStatusShow === '废止' || scope.row.standTextStatusShow === '被代替'" style="color: #F56C6C">{{
scope.row.XCXSSRQ ? scope.row.XCXSSRQ.substring(0, 10) : '-'
}}</span>
<span v-else-if="scope.row.standTextStatusShow === '——' " style="color: #409EFF">{{
scope.row.XCXSSRQ ? scope.row.XCXSSRQ.substring(0, 10) : '-'
}}</span>
<span v-else style="color: #333333">{{
scope.row.XCXSSRQ ? scope.row.XCXSSRQ.substring(0, 10) : '-'
}}</span>
</template>
</el-table-column>
<el-table-column
prop="ZCCSSRQ"
sortable="custom"
width="150"
label="在产车实施日期">
<template slot-scope="scope">
<span v-if="scope.row.standTextStatusShow === '废止' || scope.row.standTextStatusShow === '被代替'" style="color: #F56C6C">{{
scope.row.ZCCSSRQ ? scope.row.ZCCSSRQ.substring(0, 10) : '-'
}}</span>
<span v-else-if="scope.row.standTextStatusShow === '——' " style="color: #409EFF">{{
scope.row.ZCCSSRQ ? scope.row.ZCCSSRQ.substring(0, 10) : '-'
}}</span>
<span v-else style="color: #333333">{{
scope.row.ZCCSSRQ ? scope.row.ZCCSSRQ.substring(0, 10) : '-'
}}</span>
</template>
</el-table-column>
<el-table-column
prop="textStatus"
sortable="custom"
width="110"
label="文本状态">
<!-- <template slot="header" slot-scope="scope">-->
<!-- <el-tooltip class="item" effect="dark" content="计划修订”、“修订中”均为现行有效版本;“已修订”标准的有效性根据实际实施情况判定。" placement="bottom">-->
<!-- <span>文本状态 <i class="el-icon-warning-outline"></i></span>-->
<!-- </el-tooltip>-->
<!-- </template>-->
<template slot-scope="scope">
<span v-if="scope.row.standTextStatusShow === '废止' || scope.row.standTextStatusShow === '被代替'" style="color: #F56C6C">{{
scope.row.standTextStatusShow
}}</span>
<span v-else-if="scope.row.standTextStatusShow === '——' " style="color: #409EFF">{{
scope.row.standTextStatusShow
}}</span>
<span v-else style="color: #333333">{{ scope.row.standTextStatusShow }}</span>
</template>
</el-table-column>
</div>
<div v-if="handleSelectForm.dataSource === 'FOREIGN_LAWS'">
<el-table-column
show-overflow-tooltip
label="政策编号"
width="150"
>
<template slot-scope="scope">
<!-- <a v-if="scope.row.standYear" class="table-jump" @click="handlePreview(scope.row)">{{ scope.row.standSortShow }} {{ scope.row.standNumber }}-{{ scope.row.standYear }}</a>-->
<a v-if="scope.row.standStatusShow === '作废'" style="color: #F56C6C" @click="handlePreview(scope.row)" class="table-jump">{{ scope.row.lawsNumber }}</a>
<a v-if="scope.row.standStatusShow === '参考'" style="color: #E6A23C" @click="handlePreview(scope.row)" class="table-jump">{{ scope.row.lawsNumber }}</a>
<a v-if="scope.row.standStatusShow !== '作废' && scope.row.standStatusShow !== '参考'" style="color: #333333" @click="handlePreview(scope.row)" class="table-jump">{{ scope.row.lawsNumber }}</a>
</template>
</el-table-column>
<el-table-column
show-overflow-tooltip
prop="lawsName"
label="中文名称"
min-width="300"
>
<template slot-scope="scope">
<a v-if="scope.row.standStatusShow === '作废'" style="color: #F56C6C" @click="handlePreview(scope.row)" class="table-jump">{{ scope.row.lawsName }}</a>
<a v-if="scope.row.standStatusShow === '参考' " style="color: #E6A23C" @click="handlePreview(scope.row)" class="table-jump">{{ scope.row.lawsName }}</a>
<a v-if="scope.row.standStatusShow !== '作废' && scope.row.standStatusShow !== '参考'" style="color: #333333" @click="handlePreview(scope.row)" class="table-jump">{{ scope.row.lawsName }}</a>
</template>
</el-table-column>
<el-table-column
show-overflow-tooltip
prop="lawsEnName"
label="英文名称"
min-width="300"
>
<template slot-scope="scope">
<a v-if="scope.row.standStatusShow === '作废'" style="color: #F56C6C" @click="handlePreview(scope.row)" class="table-jump">{{ scope.row.lawsEnName }}</a>
<a v-if="scope.row.standStatusShow === '参考'" style="color: #E6A23C" @click="handlePreview(scope.row)" class="table-jump">{{ scope.row.lawsEnName }}</a>
<a v-if="scope.row.standStatusShow !== '作废' && scope.row.standStatusShow !== '参考'" style="color: #333333" @click="handlePreview(scope.row)" class="table-jump">{{ scope.row.lawsEnName }}</a>
</template>
</el-table-column>
<el-table-column
prop="issueTime"
label="发文日期"
sortable
width="120"
>
<template slot-scope="scope">
<span v-if="scope.row.standStatusShow === '作废'" style="color: #F56C6C">{{scope.row.issueTime ? scope.row.issueTime.slice(0, 10) : ''}}</span>
<span v-if="scope.row.standStatusShow === '参考' " style="color: #E6A23C">{{scope.row.issueTime ? scope.row.issueTime.slice(0, 10) : ''}}</span>
<span v-if="scope.row.standStatusShow !== '作废' && scope.row.standStatusShow !== '参考'">{{scope.row.issueTime ? scope.row.issueTime.slice(0, 10) : ''}}</span>
</template>
</el-table-column>
<el-table-column
prop="XCXSSRQLAWS"
label="新车实施日期"
sortable
width="150"
>
<template slot-scope="scope">
<span v-if="scope.row.standStatusShow === '作废'" style="color: #F56C6C">{{scope.row.putTime ? scope.row.putTime.slice(0, 10) : ''}}</span>
<span v-if="scope.row.standStatusShow === '参考'" style="color: #E6A23C">{{scope.row.putTime ? scope.row.putTime.slice(0, 10) : ''}}</span>
<span v-if="scope.row.standStatusShow !== '作废' && scope.row.standStatusShow !== '参考'">{{scope.row.XCXSSRQLAWS ? scope.row.XCXSSRQLAWS.slice(0, 10) : ''}}</span>
</template>
</el-table-column>
<el-table-column
show-overflow-tooltip
sortable
prop="standStatusShow"
label="文本状态"
width="110"
>
<template slot-scope="scope">
<span v-if="scope.row.standStatusShow === '作废'" style="color: #F56C6C">
{{scope.row.standStatusShow}}
</span>
<span v-if="scope.row.standStatusShow === '参考'" style="color: #E6A23C">
{{scope.row.standStatusShow}}
</span>
<span v-if="scope.row.standStatusShow !== '作废' && scope.row.standStatusShow !== '参考'">
{{scope.row.standStatusShow}}
</span>
</template>
</el-table-column>
</div>
<div v-if="handleSelectForm.dataSource === 'BUSINESS_STAND'">
<el-table-column
show-overflow-tooltip
label="企标编号"
width="150"
>
<template slot-scope="scope">
<!-- <a v-if="scope.row.standYear" class="table-jump" @click="handlePreview(scope.row)">{{ scope.row.standSortShow }} {{ scope.row.standNumber }}-{{ scope.row.standYear }}</a>-->
<a v-if="scope.row.standStatusShow === '作废'" style="color: #F56C6C" @click="handlePreview(scope.row)" class="table-jump">{{ scope.row.standCode }}</a>
<a v-if="scope.row.standStatusShow === '参考'" style="color: #E6A23C" @click="handlePreview(scope.row)" class="table-jump">{{ scope.row.standCode }}</a>
<a v-if="scope.row.standStatusShow !== '作废' && scope.row.standStatusShow !== '参考'" style="color: #333333" @click="handlePreview(scope.row)" class="table-jump">{{ scope.row.standCode }}</a>
</template>
</el-table-column>
<el-table-column
show-overflow-tooltip
prop="standName"
label="中文名称"
min-width="300"
>
<template slot-scope="scope">
<a v-if="scope.row.standStatusShow === '作废'" style="color: #F56C6C" @click="handlePreview(scope.row)" class="table-jump">{{ scope.row.standName }}</a>
<a v-if="scope.row.standStatusShow === '参考' " style="color: #E6A23C" @click="handlePreview(scope.row)" class="table-jump">{{ scope.row.standName }}</a>
<a v-if="scope.row.standStatusShow !== '作废' && scope.row.standStatusShow !== '参考'" style="color: #333333" @click="handlePreview(scope.row)" class="table-jump">{{ scope.row.standName }}</a>
</template>
</el-table-column>
<el-table-column
show-overflow-tooltip
prop="standEnName"
label="英文名称"
min-width="300"
>
<template slot-scope="scope">
<a v-if="scope.row.standStatusShow === '作废'" style="color: #F56C6C" @click="handlePreview(scope.row)" class="table-jump">{{ scope.row.standEnName }}</a>
<a v-if="scope.row.standStatusShow === '参考'" style="color: #E6A23C" @click="handlePreview(scope.row)" class="table-jump">{{ scope.row.standEnName }}</a>
<a v-if="scope.row.standStatusShow !== '作废' && scope.row.standStatusShow !== '参考'" style="color: #333333" @click="handlePreview(scope.row)" class="table-jump">{{ scope.row.standEnName }}</a>
</template>
</el-table-column>
<el-table-column
prop="issueTime"
label="发布日期"
sortable
width="120"
>
<template slot-scope="scope">
<span v-if="scope.row.standStatusShow === '作废'" style="color: #F56C6C">{{scope.row.issueTime ? scope.row.issueTime.slice(0, 10) : ''}}</span>
<span v-if="scope.row.standStatusShow === '参考' " style="color: #E6A23C">{{scope.row.issueTime ? scope.row.issueTime.slice(0, 10) : ''}}</span>
<span v-if="scope.row.standStatusShow !== '作废' && scope.row.standStatusShow !== '参考'">{{scope.row.issueTime ? scope.row.issueTime.slice(0, 10) : ''}}</span>
</template>
</el-table-column>
<el-table-column
prop="putTime"
label="实施日期"
sortable
width="120"
>
<template slot-scope="scope">
<span v-if="scope.row.standStatusShow === '作废'" style="color: #F56C6C">{{scope.row.putTime ? scope.row.putTime.slice(0, 10) : ''}}</span>
<span v-if="scope.row.standStatusShow === '参考'" style="color: #E6A23C">{{scope.row.putTime ? scope.row.putTime.slice(0, 10) : ''}}</span>
<span v-if="scope.row.standStatusShow !== '作废' && scope.row.standStatusShow !== '参考'">{{scope.row.putTime ? scope.row.putTime.slice(0, 10) : ''}}</span>
</template>
</el-table-column>
<el-table-column
show-overflow-tooltip
sortable
prop="standStatusShow"
label="文本状态"
width="110"
>
<template slot-scope="scope">
<span v-if="scope.row.standStatusShow === '作废'" style="color: #F56C6C">
{{scope.row.standStatusShow}}
</span>
<span v-if="scope.row.standStatusShow === '参考'" style="color: #E6A23C">
{{scope.row.standStatusShow}}
</span>
<span v-if="scope.row.standStatusShow !== '作废' && scope.row.standStatusShow !== '参考'">
{{scope.row.standStatusShow}}
</span>
</template>
</el-table-column>
</div>
</el-table>
<!--分页-->
<pagination
v-show="this.lawInfoTableLoading === false"
style="position: relative;"
:page="handleSelectForm.page"
:total="handleSelectForm.total"
@pageChange="handleSelectPageChange"
@pageSizeChange="handleSelectPageSizeChange"></pagination>
<div slot="footer" class="demo-drawer-footer">
<el-button class="common-button-default" round icon="el-icon-close" @click="selectModal = false">取消</el-button>
<el-button type="primary" round class="common-button-primary" icon="el-icon-check" @click="handleSelectConfirm" v-show="lawInfoTableLoading === false">确定</el-button>
</div>
</div>
</el-drawer>
</div>
</template>
<script>
import axios from 'axios'
export default {
name: "StandardRecognition",
components: {},
data() {
return {
selectTableDatas: [],
textStatusMap: {}, // 文本状态id与name对应
lawInfoTable:[],
lawInfoTableLoading: true,
//手动查找的模态框
selectModal: false,
styles: {
height: 'calc(100% - 55px)',
overflow: 'auto',
paddingBottom: '53px',
position: 'static'
},
handleSelectForm: {
standName: '', //标准名称
numberName: '', //政策名称
lawsNumber: '', //政策编号
standNumber: '', //标准编号
standCode: '', //企标编号
dataSource: 'INLAND',
lawNumber: '', // 标准编号/政策编号
lawName: '', // 标准名称/政策名称
page: 1,
pageSize: this.$store.getters.userInfo.configContent,
total: 0,
standType: '',
quoteIdList: '',
validFlag: '0',
menuId: 'nomenu'
},
tableHeight: null,
loading: false,
uploadModal: false,
title: "",
total: 0,
page: 1,
pageSize: 10,
// uploadPath: '/api/ocr/OCRRestful/upload',
uploadPath: "api/att/attFile/upload",
defaultFileList: [],
// 记录上传文件相关信息
uploadFilesdfEo: {
standNumber: "",
standName: "",
fileType: "",
attId: "",
fileName: "",
// standId: ''
},
upFileRules: {
standNumber: [
{ required: true, message: "标准号/政策号不能为空", trigger: "blur" },
],
standName: [
{
required: true,
message: "标准名称/政策名称不能为空",
trigger: "blur",
},
],
fileType: [
{ required: true, message: "文本状态称不能为空", trigger: "change" },
],
fileName: [
{ required: true, message: '文件不能为空', trigger: 'change' }
]
},
options: [],
modalType: "",
standRecoList: [],
selectTableData: [],
dropdownItems: [
{ val: "收藏" },
{ val: "分享" },
{ val: "关联" },
{ val: "删除" },
],
btnName: "",
isSubmit: false,
showUploadlist: true, // 导入过程中新增数据时,如果数据报错,不出现导入列表
collect: "收藏",
paixu: '',
shunxu: ''
};
},
props: {},
watch: {},
methods: {
// 将文本状态的id与name对应
setMap(data) {
data.forEach(item => {
this.$set(this.textStatusMap, item.value, item.label)
})
},
//手动查找的确定按钮
handleSelectConfirm(){
if (this.handleSelectTableList.length>1){
this.$message.warning('只能选择一条数据')
}else if (this.handleSelectTableList.length===0){
this.$message.warning('请选择一条数据')
}
else {
// this.attributeEO.dataSource = this.handleSelectForm.dataSource
// this.attributeEO.lawId = this.handleSelectTableList[0].id
this.uploadFilesdfEo.standNumber =this.handleSelectTableList[0].standCode || this.handleSelectTableList[0].lawsNumber || this.handleSelectTableList[0].standSort+" "+this.handleSelectTableList[0].standNumber+"-"+this.handleSelectTableList[0].standYear
this.uploadFilesdfEo.standName = this.handleSelectTableList[0].standName || this.handleSelectTableList[0].lawsName
// console.log('999',this.handleSelectTableList[0])
//文本状态,下次一定(tnnd,人家的文本状态和这个的文本状态都不是一个东西,不用画蛇添足)
// this.uploadFilesdfEo.fileType = this.handleSelectTableList[0].standTextStatusShow || this.handleSelectTableList[0].standStatusShow
this.selectModal = false
}
console.log('确定',this.handleSelectTableList)
},
handleSelectPageChange(page){
this.lawInfoTableLoading = true
this.handleSelectForm.page = page
console.log(this.handleSelectForm.page)
this.searchLawBtn()
},
handleSelectPageSizeChange(pageSize){
this.lawInfoTableLoading = true
this.handleSelectForm.pageSize = pageSize
console.log(this.handleSelectForm.pageSize)
this.searchLawBtn()
},
formatIssueDate(str) {
const momentDate = this.$moment(str)
if (momentDate.isValid()) {
return this.$moment(str).format('YYYY-MM-DD')
} else {
return str
}
},
// 点击查看
handlePreview(item) {
console.log('539',item)
if (item.standType === "INLAND"){
let routeUrlINLAND = this.$router.resolve({
name: 'OtherStandardDetails',
params: {
id: item.id,
pageType: 'INLAND_STAND'
}
})
window.open(routeUrlINLAND.href, '_blank')
}else if (item.standType === "FOREIGN"){
let routeUrlFOREIGN = this.$router.resolve({
name: 'OtherStandardDetails',
params: {
id: item.id,
pageType: 'FOREIGN_STAND'
}
})
window.open(routeUrlFOREIGN.href, '_blank')
} else if (item.country !== undefined){
let routeUrlLAWS = this.$router.resolve({
name: 'OtherLawsStandDetails',
params: {
id: item.id,
pageType: 'LAWS_STAND'
}
})
window.open(routeUrlLAWS.href, '_blank')
}else {
let routeUrlBUSINESS = this.$router.resolve({
name: 'OtherBussStandardDetails',
params: {
id: item.id,
pageType: 'BUSINESS_STAND'
}
})
window.open(routeUrlBUSINESS.href, '_blank')
}
},
// 手动查找 table选择事件
handleSelectTableChange (row) {
this.handleSelectTableList = row
console.log('我选的',this.handleSelectTableList)
},
//手动查找的清空按钮
clearLawBtn(){
this.lawInfoTableLoading = true
//清空的时候还是不要把人家选的数据源清空吧
// this.handleSelectForm.dataSource = ''
//清空标准编号/政策编号的查询
this.handleSelectForm.lawNumber = ''
this.handleSelectForm.standNumber = ''
this.handleSelectForm.lawsNumber = ''
this.handleSelectForm.standCode = ''
//清空标准名称/政策名称的查询
this.handleSelectForm.lawName = ''
this.handleSelectForm.standName = ''
this.handleSelectForm.numberName = ''
this.searchLawBtn()
},
//手动查找的查询按钮
searchLawBtn(){
this.lawInfoTableLoading = true
console.log('533',this.handleSelectForm.dataSource)
if (this.handleSelectForm.dataSource === 'INLAND'){
this.$http.get('sarStandardsInfo/sar-standards-info/getSarStandardsInfoPage',this.handleSelectForm,{
_this: this
},res=>{
console.log('国内标准库数据',res)
if (res.ok){
this.lawInfoTable = res.data.list
this.handleSelectForm.total = res.data.count
if ((this.lawInfoTable.length === 0 || this.lawInfoTable === []) && this.handleSelectForm.page !== 1) {
this.lawInfoTableLoading = true
this.handleSelectPageChange(1)
}else {
this.lawInfoTableLoading = false
this.lawInfoTableLoading = false
}
}else {
this.$message.error(res.message)
}
},e=>{
this.lawInfoTable = []
this.handleSelectForm.total = 0
})
console.log('国内标准库')
}else if(this.handleSelectForm.dataSource === 'FOREIGN'){
this.$http.get('sarStandardsInfo/sar-standards-info/getSarStandardsInfoPage',this.handleSelectForm,{
_this: this
},res=>{
console.log('海外标准库数据',res)
if (res.ok){
this.lawInfoTable = res.data.list
this.handleSelectForm.total = res.data.count
if ((this.lawInfoTable.length === 0 || this.lawInfoTable === []) && this.handleSelectForm.page !== 1) {
this.lawInfoTableLoading = true
this.handleSelectPageChange(1)
}else {
this.lawInfoTableLoading = false
}
}else {
this.$message.error(res.message)
this.lawInfoTableLoading = false
}
},e=>{
this.lawInfoTable = []
this.handleSelectForm.total = 0
})
console.log('海外标准库')
}else if(this.handleSelectForm.dataSource === 'FOREIGN_LAWS'){
this.$http.get('lawss/sarLawsInfo/page',this.handleSelectForm,{
_this: this
},res=>{
console.log('国内外政策库数据',res)
if (res.ok){
this.lawInfoTable = res.data.list
this.handleSelectForm.total = res.data.count
if ((this.lawInfoTable.length === 0 || this.lawInfoTable === []) && this.handleSelectForm.page !== 1) {
this.lawInfoTableLoading = true
this.handleSelectPageChange(1)
}else {
this.lawInfoTableLoading = false
}
}else {
this.$message.error(res.message)
this.lawInfoTableLoading = false
}
},e=>{
this.lawInfoTable = []
this.handleSelectForm.total = 0
})
console.log('国内外政策库')
}else if(this.handleSelectForm.dataSource === 'BUSINESS_STAND'){
this.$http.get('lawss/sarBussionessStand/getSarBussionStandPage',this.handleSelectForm,{
_this: this
},res=>{
console.log('企业标准库数据',res)
if (res.ok){
this.lawInfoTable = res.data.list
this.handleSelectForm.total = res.data.count
if ((this.lawInfoTable.length === 0 || this.lawInfoTable === []) && this.handleSelectForm.page !== 1) {
this.lawInfoTableLoading = true
this.handleSelectPageChange(1)
}else {
this.lawInfoTableLoading = false
}
}else {
this.$message.error(res.message)
this.lawInfoTableLoading = false
}
},e=>{
this.lawInfoTable = []
this.handleSelectForm.total = 0
})
console.log('企业标准库')
}else {
this.$message.warning('请先选择标准/政策来源')
}
},
//根据标准编号/政策编号查询
lawNumberSearch() {
this.handleSelectForm.standNumber = this.handleSelectForm.lawNumber
this.handleSelectForm.lawsNumber = this.handleSelectForm.lawNumber
this.handleSelectForm.standCode = this.handleSelectForm.lawNumber
},
//根据标准名称/政策名称查询
lawNameSearch() {
this.handleSelectForm.standName = this.handleSelectForm.lawName
this.handleSelectForm.numberName = this.handleSelectForm.lawName
},
dataSourceChange() {
this.handleSelectForm.page = 1
this.lawInfoTableLoading = true
this.handleSelectForm.standType = this.handleSelectForm.dataSource
this.searchLawBtn()
},
cancelSelectModel () {
this.selectModal = false
},
//点击手动查找按钮
handleSelect() {
this.selectModal = true
this.lawInfoTableLoading = true
this.handleSelectForm.standType = this.handleSelectForm.dataSource
this.clearLawBtn()
this.searchLawBtn()
},
handleCommand(command) {
switch (command[1]) {
case "获取文件":
this.downloadFile(command[0]);
break;
case "编辑":
this.editOcrRecord(command[0], "edit");
break;
case "删除":
this.delSingalData(command[0]);
break;
/*case "在线编辑":
this.downloadFile(command[0]);
break;*/
}
},
// 表格排序
sortChange (sortObj) {
if (sortObj.column.order !== 'normal') {
this.shunxu = ''
this.paixu = ''
let order = sortObj.column.order
switch (sortObj.column.property) {
case 'spendTime' :
// 后台联调
this.paixu = 'spendTime'
if (order === 'ascending'){
this.shunxu = 'asc'
} else if (order === 'descending') {
this.shunxu = 'desc'
}
break
}
}
this.getTableData()
},
// 修改成表格样式后,选择项勾选改变
standSelectChange(data) {
this.selectTableData = [];
for (let i = 0; i < data.length; i++) {
this.selectTableData.push(data[i].id);
this.selectTableDatas.push(data[i])
}
},
// 上传
uploadNum() {
this.$message({
message: '最多只能上传一份',
type: 'warning'
})
},
uploadPdf() {
this.modalType = "1";
this.title = "上传文件";
this.uploadModal = true;
this.btnName = "转换";
this.defaultFileList = [];
},
uploadSuccess(res, file, fileList) {
if (res.ok) {
// this.uploadFilesdfEo.id = res.data
this.uploadFilesdfEo.attId = res.data.id;
if (res.data.standNum != null && res.data.standNum !== "") {
this.uploadFilesdfEo.standNumber = res.data.standNum;
}
if (res.data.standName != null && res.data.standName !== "") {
this.uploadFilesdfEo.standName = res.data.standName;
}
this.uploadFilesdfEo.fileName = res.data.name
// this.getTableData()
this.defaultFileList.push(file);
this.$message({
message: "文件上传成功",
type: "success",
});
this.$refs['uploadFilesdfEo'].clearValidate('fileName')
this.$refs['uploadFilesdfEo'].clearValidate('standName')
} else {
this.defaultFileList = [];
this.uploadFilesdfEo.attId = "";
this.$message.error(res.message);
fileList.pop();
}
},
removeOneFile(file, fileList) {
this.defaultFileList = [];
this.uploadFilesdfEo.attId = "";
},
beforeUpload(file) {
var filename = file.name;
var index1 = filename.lastIndexOf(".");
var index2 = filename.length;
var fileSuffix = filename.substring(index1, index2);
// const fileSuffix = file.name.split('.')[1] // 后缀名
// 判断上传文件格式
if (
fileSuffix === ".pdf" ||
fileSuffix === ".PDF"
) {
return true;
} else {
this.$message.error(
"文件" +
file.name +
"格式不正确,请上传pdf文件"
);
return false;
}
// 判断文件上传大小
// eslint-disable-next-line no-unreachable
if (file.size / 1024 / 1024 <= 200) {
return true;
} else {
this.$message.error("文件" + file.name + "大小不超过200M");
return false;
}
return true;
},
cancel() {
this.uploadFilesdfEo = {
standNumber: "",
standName: "",
fileType: "",
attId: "",
fileName: "",
}
this.defaultFileList = []
this.uploadModal = false;
this.$refs["importFileAboutStand"].clearFiles();
},
// 编辑
editOcrRecord() {
if (this.selectTableDatas.length === 1) {
let row = this.selectTableDatas[0]
this.modalType = "2";
this.title = "编辑信息";
this.btnName = "保存";
this.uploadFilesdfEo.fileName = row.fileName
this.uploadModal = true;
this.uploadFilesdfEo.standNumber = JSON.parse(
JSON.stringify(row)
).standNumber;
this.uploadFilesdfEo.standName = JSON.parse(
JSON.stringify(row)
).standName;
// this.uploadFilesdfEo.fileType = JSON.parse(JSON.stringify(row)).fileType
this.options.map((item) => {
if (item.attrName === JSON.parse(JSON.stringify(row)).fileType) {
this.uploadFilesdfEo.fileType = item.attrName;
}
});
this.uploadFilesdfEo.id = JSON.parse(JSON.stringify(row)).id;
this.uploadFilesdfEo.attId = "";
this.defaultFileList = [];
} else {
this.$message.warning('请选择一条数据进行编辑')
}
},
// 提交
uploadSave() {
this.$refs["uploadFilesdfEo"].validate((valid) => {
if (valid) {
if (this.modalType === "1") {
if (
this.uploadFilesdfEo.attId != null &&
this.uploadFilesdfEo.attId !== ""
) {
this.isSubmit = true;
this.uploadFilesdfEo.fileType = this.uploadFilesdfEo.fileType.toString();
this.$http.post(
"ocr/OCRRestful/addOcrRecord",
this.uploadFilesdfEo,
{
_this: this,
},
(res) => {
if (res.ok) {
this.isSubmit = false;
this.uploadModal = false;
this.getTableData();
} else {
this.isSubmit = false;
}
},
(e) => {
this.isSubmit = false;
}
);
} else {
this.$message.warning("转换文件不能为空");
}
} else if (this.modalType === "2") {
this.isSubmit = true;
this.$http.putData(
"ocr/OCRRestful/updateOcrRecord",
this.uploadFilesdfEo,
{
_this: this,
},
(res) => {
if (res.ok) {
this.isSubmit = false;
this.uploadModal = false;
this.getTableData();
} else {
this.isSubmit = false;
// this.$message.error(res.message);
}
},
(e) => {
this.isSubmit = false;
}
);
}
}
});
},
// 获取选中数据
selectStanderChange(data) {
this.selectTableData = data;
},
// 获取doc文件
downloadFile(data) {
let URL = 'https://srms.foton.com.cn/ocrResultFile/' + data.docRealName
window.open(URL)
// console.log(URL);
// window.open(data.docRealFile);
},
// 删除
delSingalData(row) {
if (this.selectTableData.length === 0) {
this.$confirm("确认删除这些数据?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
confirmButtonClass: "common-button-primary",
roundButton: false,
type: "warning",
}).then(() => {
this.$http.delete(
"ocr/OCRRestful/deleteOcrRecord",
{
ids: row.id,
},
{
_this: this,
},
(res) => {
if (res.ok) {
this.getTableData();
} else {
this.getTableData();
// this.$message.error(res.message)
}
}
);
});
}
},
// 批量删除
delData() {
if (this.selectTableData.length === 0) {
this.$confirm("请选择一条数据进行删除", "提示", {
showCancelButton: false,
confirmButtonText: "确定",
cancelButtonText: "取消",
confirmButtonClass: "common-button-primary",
type: "warning",
roundButton: false,
});
} else {
this.$confirm("确认删除这些数据?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
confirmButtonClass: "common-button-primary",
roundButton: false,
}).then(() => {
let idsList = [];
this.selectTableData.map((item) => {
idsList.push(item);
});
this.$http.delete(
"ocr/OCRRestful/deleteOcrRecord",
{
ids: idsList.join(","),
},
{
_this: this,
},
(res) => {
if (res.ok) {
this.getTableData();
} else {
this.getTableData();
// this.$message.error(res.message)
}
}
);
});
}
},
// 转化
changeData() {},
// 分页点击后方法
pageChange(page) {
this.page = page;
this.getTableData();
},
// 分页每页显示数改变后方法
pageSizeChange(pageSize) {
this.pageSize = pageSize;
this.getTableData();
},
// 获取表格数据
getTableData() {
this.$http.post(
"ocr/OCRRestful/getAllOcrResult",
{
page: this.page,
pageSize: this.pageSize,
paixu: this.shunxu ? this.paixu : '',
shunxu: this.shunxu
},
{
_this: this,
loading: "loading",
},
(res) => {
if (res.ok) {
this.standRecoList = res.data.list;
console.log(this.standRecoList);
this.total = res.data.count
}
},
e => {}
);
},
},
computed: {},
created() {},
mounted() {
this.$http.get('lawss/sarStandAttrDetails/getListData', '', {
_this: this
}, res => {
let option = []
res.data.map(item => {
if (item.sarType === 'STAND' || item.sarType === 'INLAND_STAND') {
option.push(item)
}
})
this.options = option
})
this.getTableData();
},
destroyed() {},
};
</script>
<style lang="less" scope>
.standardRecognition {
height: 100%;
background: #fff;
display: flex;
flex-direction: column;
.action-bar {
margin-bottom: 5px;
}
.content {
flex: auto;
overflow: hidden;
position: relative;
margin-bottom: 10px;
}
.pagination {
position: static;
/deep/.pagination-slot {
padding: 0;
}
}
}
</style>