Files
foton-laws-system-front/src/pages/regulatoryRepository/foreignStandardsAndRegulations/index.vue
T
2021-06-17 15:37:45 +08:00

3773 lines
142 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!--标准法规--海外标准法规-->
<template>
<div id="foreignStandardsAndRegulations" :class="{ 'tree-close': sideClose }" class="demo-spin-article v-class">
<div class="tree-content" :class="{ 'tree-closed': sideClose }">
<div class="tree">
<laws-tree :zNodes="zNodes"
ref="domesticTree"
treeDivId="domesticTree"
showRMenu
deptSelect
autoSelect
add-id="QE4VD4BUQY"
edit-id="NR9VRJ3VY3"
remove-id="NTUFYC8TCC"
:drag="hasPermissionDrag"
drag-bind=".drag-table"
drag-dom="drag-row"
:hideRMenuNode="['gxhbq', 'wdsc']"
:loading="menuTreeLoading"
@treeAdd="(treeId, treeNode) => clickDropMenu('newMenu', treeNode)"
@treeEdit="(treeId, treeNode) => clickDropMenu('editMenu', treeNode)"
@treeClick="(treeId, treeNode) => treeClick(treeNode)"
@treeRightClick="(treeId, treeNode) => treeRightClick(treeNode)"
@treeRemove="(treeId, treeNode) => clickDropMenu('deleteMenu', treeNode)"
@drag="drag"
></laws-tree>
</div>
<div class="tree-collapse" @click="treeCollapse" :class="{ 'tree-close': sideClose }">
<!--切换折叠样式-->
<i class="el-icon-arrow-left" v-if="sideClose === false"></i>
<i class="el-icon-arrow-right" v-if="sideClose === true"></i>
</div>
</div>
<div class="tree-right">
<!--高级查询 ------------按钮-->
<table-tools-bar>
<div slot="content">
</div>
<div slot="left">
<div class="search-area">
<div class="left">
<el-form :modal="standCommonlySearch" inline class="label-input-form" @keyup.enter.native="searchBtnClick(standCommonlySearch)">
<el-form-item label="标准类别" class="search-item">
<el-select v-model="standCommonlySearch.standSort" filterable>
<el-option
v-for="item in standSortOptions"
:key="item.value"
:value="item.value"
:label="item.label"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="标准号/名称" class="search-item search-item-last">
<el-input v-model="standCommonlySearch.standNumber"
placeholder="请输入"
clearable
@keyup.enter="searchBtnClick(standCommonlySearch)"
:maxlength="100"
></el-input>
</el-form-item>
<el-form-item class="search-item btn-box">
<el-button
:loading="searching"
icon="el-icon-search"
type="primary"
class="common-button-primary"
size="mini"
@click="searchBtnClick(standCommonlySearch)">
</el-button>
<el-button
class="common-button-default"
icon="el-icon-refresh-left"
size="mini"
@click="clearAllSearch('standCommonlySearch')"></el-button>
<el-button type="primary" class="common-button-primary" size="mini" @click="selectMoreBtn"><i class="iconfont">&#xe7a5;</i>高级查询</el-button>
</el-form-item>
</el-form>
</div>
</div>
</div>
<div slot="right" class="right shaixuan-button">
<!--<el-button icon="shaixuan" type="primary" class="common-button-primary" size="mini" @click="selectMoreBtn">高级查询</el-button>-->
</div>
</table-tools-bar>
<div class="action-bar">
<el-button type="primary"
class="common-button-primary add-button"
size="mini"
@click="addModal"
v-btn-permission="'ceb5fb1e00'"
:disabled="addBtnDisabled"><i class="iconfont">&#xe84e;</i>新增</el-button>
<el-button class="common-button-default in-button"
size="mini"
:loading="searching"
@click="addImportModal(1)"
v-btn-permission="'FQ5ECZ286K'"><i class="iconfont">&#xe6de;</i>导入</el-button>
<el-button class="common-button-default export-button"
size="mini"
@click="exportStandard()"
title="不勾选时默认导出所有筛选项;勾选时仅导出勾选项"
v-btn-permission="'J2X4KHNN4N'"><i class="iconfont">&#xe6e9;</i>导出</el-button>
<el-button class="common-button-default delete-button"
:loading="delLoading"
size="mini"
@click="deleteStand(2)"
v-btn-permission="'YZ2A6NPGFP'"><i class="iconfont">&#xe61b;</i>批量删除</el-button>
<el-button class="common-button-default"
size="mini"
@click="deleteStandFromKind(2)"
v-btn-permission="'XSS8C793DQ'"><i class="iconfont">&#xe611;</i>移除标准</el-button>
<el-button class="common-button-default"
size="mini" :loading="searching"
@click="uploadImportModal(1)"
v-btn-permission="'4mFaJU3fTS'"><i class="iconfont">&#xe825;</i>模板下载</el-button>
<el-button class="common-button-default"
size="mini" @click="configurationStandard"
v-btn-permission="'98RZSZMZVQ'"><i class="iconfont">&#xe669;</i>配置标准</el-button>
</div>
<div class="content">
<div class="table-wrap">
<el-table
ref="multipleTable"
:data="stahndinfoList"
tooltip-effect="dark"
border
style="width: 100%; flex: auto;"
class="drag-table"
height="100%"
:row-class-name="dragRowClassName"
:header-cell-style="{background: '#e8e8e8', color: '#333333', fontSize: '16px',
fontWeight: 'bold', height: '48px'}"
@selection-change="standSelectChange"
@sort-change="sortChange">
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
label="标准号"
>
<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-else @click="handlePreview(scope.row)" class="table-jump">{{ scope.row.standSortShow }} {{ scope.row.standNumber }}</a>
</template>
</el-table-column>
<el-table-column
prop="standName"
label="标准名称"
>
<template slot-scope="scope">
<a @click="handlePreview(scope.row)" class="table-jump">{{ scope.row.standName }}</a>
</template>
</el-table-column>
<el-table-column
prop="issueTime"
sortable="custom"
width="110px"
label="发布日期">
<template slot-scope="scope">
{{ formatIssueDate(scope.row.issueTime) }}
</template>
</el-table-column>
<el-table-column
prop="XCXSSRQ"
sortable="custom"
width="150px"
label="新车型实施日期">
<template slot-scope="scope">
<span>{{ formatText(scope.row.XCXSSRQ) }}</span>
</template>
</el-table-column>
<el-table-column
prop="ZCCSSRQ"
sortable="custom"
width="150px"
label="在产车实施日期">
<template slot-scope="scope">
<span>{{ formatText(scope.row.ZCCSSRQ) }}</span>
</template>
</el-table-column>
<el-table-column
prop="standStateShow"
sortable="custom"
width="120px"
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>
</el-table-column>
<el-table-column label="操作" align="center" width="50" fixed="right">
<template slot-scope="scope">
<div @click.stop style="display: inline-block">
<el-dropdown trigger="click" @command="handleCommand">
<i class="iconfont">&#xe61e;</i>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item
v-if="scope.row.collectBtn"
:command="[scope.row, '收藏']"
v-btn-permission="'8XUDZZEERN'"
>
收藏
</el-dropdown-item>
<el-dropdown-item
v-else
:command="[scope.row, '取消收藏']"
v-btn-permission="'8XUDZZEERN'"
>
取消收藏
</el-dropdown-item>
<el-dropdown-item :command="[scope.row, '编辑']" v-btn-permission="'PVSCKGE7XU'">编辑</el-dropdown-item>
<el-dropdown-item :command="[scope.row, '分享']" v-btn-permission="'LTS4PZ2AR7'">分享</el-dropdown-item>
<el-dropdown-item :command="[scope.row, '删除']" v-btn-permission="'YZ2A6NPGFP'">删除</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</template>
</el-table-column>
</el-table>
</div>
<pagination :page="standCommonlySearch.page" :total="total"
@pageChange="pageChange" @pageSizeChange="pageSizeChange"></pagination>
</div>
<loading :loading="menuTreeLoading || loading">数据获取中</loading>
<!--导出文件改名字模态框-->
<el-dialog :visible.sync="exportModelFlag" title="导出文件" width="300px">
<el-form :inline="true" class="label-input-form search-area">
<el-form-item label="导出名称" class="search-item">
<el-input v-model="exportName" placeholder="请输入导出文件名称" :maxlength="30" clearable label="导出名称"/>
</el-form-item>
</el-form>
<span slot="footer" class="demo-drawer-footer">
<el-button size="mini" class="common-button-default" icon="el-icon-close" @click="cancal">取消</el-button>
<el-button type="primary" size="mini" class="common-button-primary" icon="el-icon-check" @click="exportTestItem">提交</el-button>
</span>
</el-dialog>
<table-tools-bar v-model="isAdvancedSearch" @search="getDomesticStandardTableBtn(sarStandardsSearch)"
@reset="clearAllSearch('sarStandardsSearch')">
<div slot="content">
<el-form :model="sarStandardsSearch" :inline="true" class="label-input-form table-lattice" style="display: flex;flex-wrap: wrap">
<!-- 标准号-->
<el-form-item :label="$t('m.standardNo')" class="serch-form-item">
<el-input v-model="sarStandardsSearch.standNumber" :placeholder="$t('m.lookUpByStandardNumber')" clearable :maxlength="100"
@keyup.enter.native="getDomesticStandardTableBtn(sarStandardsSearch)"></el-input>
</el-form-item>
<!-- 标准名称-->
<el-form-item :label="$t('m.standName')" class="serch-form-item">
<el-input v-model="sarStandardsSearch.standName" :placeholder="$t('m.searchByStandardName')" clearable :maxlength="500"
@keyup.enter.native="getDomesticStandardTableBtn(sarStandardsSearch)"></el-input>
</el-form-item>
<!-- 标准类别-->
<el-form-item :label="$t('m.standardCategory')" class="serch-form-item">
<search-select
v-model="sarStandardsSearch.standSort"
:placeholder="$t('m.standardCategoryTips')"
@keyup.enter.native="getDomesticStandardTableBtn(sarStandardsSearch)"
:options="standSortOptions"
clearable/>
</el-form-item>
<!-- 文本状态-->
<el-form-item :label="$t('m.standStateShow')" class="serch-form-item">
<el-select v-model="sarStandardsSearch.textStatus" :placeholder="$t('m.lookupByStandardStatus')" clearable
@keyup.enter.native="getDomesticStandardTableBtn(sarStandardsSearch)">
<el-option v-for="opt in standStateOptions" :value="opt.value === undefined ? '' :opt.value" :key="opt.value" :label="opt.label">{{ opt.label}}</el-option>
</el-select>
</el-form-item>
<!-- 代替标准号-->
<el-form-item :label="$t('m.substituteStandardNumber')" class="serch-form-item">
<el-input v-model="sarStandardsSearch.dtbjh" :placeholder="$t('m.lookUpByAlternativeCriteria')" clearable :maxlength="100"
@keyup.enter.native="getDomesticStandardTableBtn(sarStandardsSearch)"></el-input>
</el-form-item>
<!-- 适用车型-->
<el-form-item :label="$t('m.applicableModels')" class="serch-form-item">
<el-select v-model="sarStandardsSearch.cllx" :placeholder="$t('m.searchAccordingToThApplicableModel')" clearable
@keyup.enter.native="getDomesticStandardTableBtn(sarStandardsSearch)">
<el-option v-for="opt in applyArcticOptions" :value="opt.value === undefined ? '' :opt.value" :key="opt.value" :label="opt.label">{{ opt.label}}</el-option>
</el-select>
</el-form-item>
<!-- 适用产品线新增字段-->
<el-form-item :label="$t('m.applicableProductLine')" class="serch-form-item">
<el-select v-model="sarStandardsSearch.nylx" :placeholder="$t('m.searchByApplicableProductLine')" clearable
@keyup.enter.native="getDomesticStandardTableBtn(sarStandardsSearch)">
<el-option v-for="opt in categoryOptions" :value="opt.value === undefined ? '' :opt.value" :key="opt.value" :label="opt.label">{{ opt.label}}</el-option>
</el-select>
</el-form-item>
<!-- 关联模块新增字段-->
<el-form-item :label="$t('m.associatedModule')" class="serch-form-item">
<el-select v-model="sarStandardsSearch.cycvppsbm" :placeholder="$t('m.SearchByAssociatedModule')" clearable
@keyup.enter.native="getDomesticStandardTableBtn(sarStandardsSearch)">
<el-option v-for="opt in standNatureOptions" :value="opt.value === undefined ? '' :opt.value" :key="opt.value" :label="opt.label">{{ opt.label}}
</el-option>
</el-select>
</el-form-item>
</el-form>
</div>
</table-tools-bar>
<!-- 新增海外标准 -->
<el-drawer
:title="modalshowtitle"
:visible.sync="modalshowflag"
:wrapperClosable="false"
size="800px"
@close="resetForm"
>
<!-- 新增样式 -->
<div class="demo-drawer-content">
<el-form
v-if="reloadAddForm"
ref="sarStandardsInfoForm"
:model="sarStandardsInfoEO"
:rules="sarStandardsInfoRules"
class="label-input-form"
>
<el-form-item
prop="isRelateAccess"
label-width="150px"
class="add-form-item"
title="A类必填项多,仅A类可纳入法规清单。"
>
<template slot="label">重要度<i class="el-icon-warning-outline"></i></template>
<el-select v-model="sarStandardsInfoEO.isRelateAccess" @change="isRegulationsChange">
<el-option value="1" label="A" key="1"></el-option>
<el-option value="0" label="B" key="0"></el-option>
</el-select>
</el-form-item>
<el-form-item label="标准类别" prop="standSort" label-width="150px" class="add-form-item">
<el-select v-model="sarStandardsInfoEO.standSort" filterable>
<el-option
v-for="item in standSortOptions"
placeholder="请选择"
:key="item.value"
:value="item.value"
:label="item.label"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="标准编号" prop="standNumber" label-width="150px" class="add-form-item">
<el-input v-model="sarStandardsInfoEO.standNumber"
placeholder="请输入标准编号"
clearable></el-input>
</el-form-item>
<el-form-item label="标准年份/系列" prop="standYear" label-width="150px" class="add-form-item">
<el-input v-model="sarStandardsInfoEO.standYear"
placeholder="请输入标准年份/系列"
clearable></el-input>
</el-form-item>
<el-form-item label="中文名称" prop="standName" label-width="150px" class="add-form-item">
<el-input v-model="sarStandardsInfoEO.standName"
placeholder="请输入标准名称"
clearable></el-input>
</el-form-item>
<el-form-item label="英文名称" prop="standEnName" label-width="150px" class="add-form-item">
<el-input v-model="sarStandardsInfoEO.standEnName"
placeholder="请输入标准英文名称"
clearable></el-input>
</el-form-item>
<el-form-item title="“计划修订”、“修订中”均为现行有效版本;“已修订”标准的有效性根据实际实施情况判定。"
prop="standState" label-width="150px" class="add-form-item">
<template slot="label">标准状态<i class="el-icon-warning-outline"></i></template>
<el-select v-model="sarStandardsInfoEO.standState"
placeholder="请选择标准状态"
clearable>
<el-option
v-for="opt in standStateOptions"
:disabled="opt.value !== 'ZTXXYX' && opt.value !== standState && modalshowtitle !== '编辑海外标准'"
:key="opt.value"
:value="opt.value === undefined ? '' :opt.value" :label="opt.label"
>
{{ opt.label }}
</el-option>
</el-select>
</el-form-item>
<custom-date-pick-with-text2
:config="{
attrName: '发布日期',
attrField: 'issueTime'
}"
v-model="sarStandardsInfoEO.issueTime"
:disabled="formdisableflag"
></custom-date-pick-with-text2>
<el-form-item label="文本说明" prop="synopsis" label-width="150px" class="add-form-item">
<el-input
type="text"
v-model="sarStandardsInfoEO.synopsis"
placeholder="请输入"
clearable
></el-input>
</el-form-item>
<!-- 动态数据-->
<template v-for="(displayLocation, index) in dynamicFormField">
<el-col :span="24" :key="index">
<div class="divider-line">{{ displayLocation.label }}</div>
</el-col>
<template v-for="field in displayLocation.child">
<template v-if="field.attrField === 'EOPSSRQ'">
<custom-eop-date-pick
:key="field.attrField"
:config="field"
v-model="sarStandardsInfoEO[field.attrField]"
:disabled="formdisableflag"
></custom-eop-date-pick>
</template>
<template v-else-if="field.attrField === 'SVPPS'">
<custom-SVPPS
:key="field.attrField"
:config="field"
v-model="sarStandardsInfoEO[field.attrField]"
:disabled="formdisableflag"
></custom-SVPPS>
</template>
<template v-else-if="field.attrField === 'XCXSSRQ' || field.attrField === 'ZCCSSRQ'">
<custom-date-pick-with-text
:key="field.attrField"
:config="field"
v-model="sarStandardsInfoEO[field.attrField]"
:disabled="formdisableflag"
></custom-date-pick-with-text>
</template>
<template v-else-if="field.attrType === 'DATE_PIC_OPTS'">
<custom-date-pick-group
:key="field.attrField"
:config="field"
v-model="sarStandardsInfoEO[field.attrField]"
:disabled="formdisableflag"
></custom-date-pick-group>
</template>
<template v-else-if="field.attrType === 'INPUT_STR' && field.attrField !== 'XGLC' && field.attrField !== 'CHJL'">
<template v-if="field.attrField === 'DTBJH' || field.attrField === 'YYBJ' || field.attrField === 'BYYBJ' || field.attrField === 'CBBH' || field.attrField === 'DXBZ'">
<custom-input-for-standards
:key="field.attrField"
:config="field"
v-model="sarStandardsInfoEO[field.attrField]"
:disabled="formdisableflag"
:data-source-from="field.attrField === 'CBBH' ? 'ALL' : 'INLAND'"
:data-source="field.attrField === 'CBBH'"
></custom-input-for-standards>
</template>
<template v-else>
<custom-input
:key="field.attrField"
:config="field"
v-model="sarStandardsInfoEO[field.attrField]"
:disabled="formdisableflag"
v-if="field.attrField !== 'BDTBZBH'"
></custom-input>
</template>
</template>
<template v-else-if="field.attrType === 'INPUT_NUM'">
<custom-input-num
:key="field.attrField"
:config="field"
v-model="sarStandardsInfoEO[field.attrField]"
:disabled="formdisableflag"
></custom-input-num>
</template>
<template v-else-if="field.attrType === 'DATE_PICKER'">
<custom-date-pick
:key="field.attrField"
:config="field"
v-model="sarStandardsInfoEO[field.attrField]"
:disabled="formdisableflag"
></custom-date-pick>
</template>
<template v-else-if="field.attrType === 'FILE'">
<custom-file
:key="field.attrField"
:config="field"
v-model="sarStandardsInfoEO[field.attrField]"
:disabled="formdisableflag"
@fileSuccess="fileSuccess"
></custom-file>
</template>
<template v-else-if="field.attrType === 'TEXTAREA'">
<custom-textarea
:key="field.attrField"
:config="field"
v-model="sarStandardsInfoEO[field.attrField]"
:disabled="formdisableflag"
></custom-textarea>
</template>
<template v-else-if="field.selVal === 'ORGLIST' || field.selVal === 'USERLIST' || field.selVal === 'ROLELIST'">
<template v-if="field.attrField === 'XMPGJS'">
<custom-role-tree
:key="field.attrField"
:config="field"
v-model="sarStandardsInfoEO[field.attrField]"
:disabled="formdisableflag"
:data-model="sarStandardsInfoEO"
:isRoleHierarchy="false"
roleHierarchyName="VSE,FO,工程师"
></custom-role-tree>
</template>
<template v-else-if="field.attrField === 'ZRBM'">
<custom-org
:key="field.attrField"
:config="field"
:zNodes="orgData"
v-model="sarStandardsInfoEO[field.attrField]"
:disabled="formdisableflag"
:data-model="sarStandardsInfoEO"
@on-checked="onChecked"
></custom-org>
</template>
<template v-else>
<custom-org
:key="field.attrField"
:config="field"
:zNodes="orgData"
v-model="sarStandardsInfoEO[field.attrField]"
:disabled="formdisableflag"
:data-model="sarStandardsInfoEO"></custom-org>
</template>
</template>
<template v-else-if="field.attrType === 'SEL_OPTION'">
<custom-select
:key="field.attrField"
:config="field"
v-model="sarStandardsInfoEO[field.attrField]"
:disabled="formdisableflag"
></custom-select>
</template>
<template v-else-if="field.attrType === 'SEL_OPTS' && field.attrField !== 'ZRLX'">
<custom-select-array
:key="field.attrField"
:config="field"
v-model="sarStandardsInfoEO[field.attrField]"
:disabled="formdisableflag"
></custom-select-array>
</template>
</template>
</template>
</el-form>
</div>
<div class="demo-drawer-footer">
<el-button v-show="modalshowtitle === '新增海外标准'" type="primary" size="mini" class="common-button-primary" icon="el-icon-check" @click="saveBt">保存</el-button>
<el-button size="mini" class="common-button-primary" icon="el-icon-check" type="primary" @click="saveOrUpdateStands" :loading="isSubmit">提交</el-button>
<el-button size="mini" class="common-button-default" icon="el-icon-close" @click="resetForm">取消</el-button>
</div>
</el-drawer>
<!-- 法规解读标准引用-->
<el-dialog title="法规解读标准引用" :visible.sync="lawsExplainQuoteModel" :close-on-click-modal="false" width="875px">
<el-form :modal="lawsExplainQuoteForm" :inline="true" class="label-input-form">
<el-formItem label="标准号/名称" class="serch-form-item">
<el-input v-model="lawsExplainQuoteForm.standNumber" placeholder="根据标准号/名称查找" clearable :maxlength="100"
@click.native="getDomesticStandardTableBtn(standCommonlySearch)"></el-input>
</el-formItem>
<el-button
:loading="searching"
icon="el-icon-search"
type="primary"
size="mini"
class="newSearchBtn"
@click="getLawsExplainQuoteRow(1,lawsExplainQuoteForm.pageSize, 'search')">
</el-button>
<el-button type="primary" @click="getLawsExplainQuoteRow('')" size="mini" class="searchAngNewBtn">清空查询</el-button>
</el-form>
<el-table
ref="selections"
:data="lawsExplainQuoteRow"
:loading="lawsExplainQuoteFormLoading"
tooltip-effect="dark"
style="width: 100%;height:300px; overflow-y: auto;overflow-x: hidden;"
border
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
@selection-change="selectLawsExplainQuoteRowChange"
@select="(selection, row) =>selectLawsExplainQuoteRowSelect(selection,'select', row )"
@select-all="(selection) =>selectLawsExplainQuoteRowSelect(selection, 'all')">
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
prop="standNumber"
label="标准号"
width="130"
align="center">
</el-table-column>
<el-table-column
prop="standName"
label="标准名称"
width="130"
align="center">
</el-table-column>
<el-table-column
prop="issueTime"
label="发布日期"
width="130"
align="center">
</el-table-column>
<el-table-column
prop="putTime"
label="实施日期"
width="130"
align="center">
</el-table-column>
<el-table-column
prop="standStateShow"
label="标准状态"
width="130"
align="center">
</el-table-column>
</el-table>
<!--分页-->
<pagination
:page="page"
:total="total"
@pageChange="pageChangeLaws"
@pageSizeChange="pageSizeChangeLaws"></pagination>
<div slot="footer" class="dialog-footer">
<el-button type="primary" size="mini" @click="canle">取消</el-button>
<el-button type="primary" size="mini" @click="lawsExplainQuoteModelBt">确定</el-button>
</div>
</el-dialog>
<!-- 试验项目-->
<el-dialog title="试验项目" :visible.sync="testItemsModel" :close-on-click-modal="false" width="1138px">
<el-form :modal="testItemsForm" :inline="true" class="label-input-form">
<el-formItem label="试验项目名称" class="serch-form-item">
<el-input v-model="testItemsForm.testItemName" placeholder="按试验项目名称查找" :maxlength="100" clearable
@keyup.enter.native="selectTestItemClassBtn"/>
</el-formItem>
<el-button class="common-button-primary" type="primary" icon="el-icon-search" size="mini" @click="getTestItemRow(1)"></el-button>
<el-button class="common-button-default" icon="el-icon-refresh-left" @click="getTestItemRow('')" size="mini"></el-button>
</el-form>
<el-table
ref="selections"
:data="testItemTableList"
:loading="testItemSearching"
tooltip-effect="dark"
style="width: 100%;height:300px; overflow-y: auto;overflow-x: hidden;"
border
:header-cell-style="{background: '#f8f8f9', color: '#515a6e'}"
@selection-change="selectTestItemRowChange"
@select="(selection, row) =>selectTestItemRowSelect(selection,'select', row )"
@select-all="(selection) =>selectTestItemRowSelect(selection, 'all')">
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
prop="testItemCode"
label="项目代码"
width="130"
align="center">
</el-table-column>
<el-table-column
prop="testObj"
label="试验对象"
width="130"
align="center">
</el-table-column>
<el-table-column
prop="testItemName"
label="试验项目名称"
width="130"
align="center">
</el-table-column>
<el-table-column
prop="authTypeShow"
label="适用认证"
width="130"
align="center">
</el-table-column>
<el-table-column
prop="standCode"
label="标准号"
width="130"
align="center">
</el-table-column>
<el-table-column
prop="standName"
label="标准名称"
width="130"
align="center">
</el-table-column>
<el-table-column
prop="creationUser"
label="创建人"
width="130"
align="center">
</el-table-column>
<el-table-column
prop="creationTime"
label="创建日期"
width="130"
align="center">
</el-table-column>
</el-table>
<pagination
:page="pageItems"
:total="totalItems"
@pageChange="pageChangeItems"
@pageSizeChange="pageSizeChangeItems"></pagination>
<div slot="footer" class="demo-drawer-footer">
<el-button size="mini" class="common-button-primary" icon="el-icon-check" @click="testItemsModel=false">取消</el-button>
<el-button type="primary" size="mini" class="common-button-default" icon="el-icon-close" @click="testItemsModellBt">提交</el-button>
</div>
</el-dialog>
<!-- 导入模态窗----失败有弹框 -->
<el-dialog width="400px" :visible.sync="importModalshowflag" title="导入文件">
<el-upload
multiple
drag
:action="importExcelUrl"
ref="importfile"
name="file"
accept=".ZIP, .zip"
:on-progress="onProgress"
:before-upload="beforeUploadTop"
:on-success="importFileSuccess"
:show-file-list="false">
<i class="el-icon-upload"></i>
<div class="el-upload__text">点击或拖拽上传文件</div>
</el-upload>
</el-dialog>
<!-- 配置标准 -->
<el-drawer
title="配置标准"
:wrapperClosable="false"
:visible.sync="configStandFlag"
size="1200px"
>
<div class="demo-drawer-content">
<div class="search-area">
<div class="left">
<el-form :model="sarConfigStandSearch" :inline="true" class="label-input-form">
<el-formItem label="标准类别" prop="standSort" class="search-item">
<el-select v-model="sarConfigStandSearch.standSort" placeholder="根据标准类别查找"
@keyup.enter.native="searchConfiguraStand" clearable>
<el-option v-for="opt in standSortOptions" :value="opt.value === undefined ? '' :opt.value" :key="opt.value" :label="opt.label">{{ opt.label }}
</el-option>
</el-select>
</el-formItem>
<el-formItem label="标准号/名称" prop="standNumber" class="search-item">
<el-input v-model="sarConfigStandSearch.standNumber" @keyup.enter.native="searchConfiguraStand"
placeholder="根据标准号/名称查找" clearable/>
</el-formItem>
<el-form-item label="" class="search-item btn-box">
<el-button class="common-button-primary" type="primary" icon="el-icon-search" size="mini" @click="selectConfiguraStand"></el-button>
</el-form-item>
<el-form-item label="" class="search-item btn-box">
<el-button class="common-button-default" icon="el-icon-refresh-left" @click="clearAllSearch(3)" size="mini"></el-button>
</el-form-item>
</el-form>
</div>
</div>
<div class="drawer-content">
<el-table
ref="selection"
:data="configStandList"
tooltip-effect="dark"
border
:header-cell-style="{background: '#e8e8e8', color: '#333333', fontSize: '16px',
fontWeight: 'bold', height: '48px'}"
height="100%"
@selection-change="selectConfigStandChange">
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column
prop="standNumber"
label="标准号"
align="center"
>
</el-table-column>
<el-table-column
prop="standName"
label="标准名称"
width="200"
align="center">
</el-table-column>
<el-table-column
prop="issueTime"
label="发布日期"
sortable
width="200"
align="center">
<template slot-scope="scope">
{{ scope.row.issueTime || '' }}
</template>
</el-table-column>
<el-table-column
prop="XCXSSRQ"
label="实施日期"
sortable
width="200"
align="center">
<template slot-scope="scope">
<span>{{ formatText(scope.row.XCXSSRQ) }}</span>
</template>
</el-table-column>
<el-table-column
prop="standStateShow"
label="标准状态"
width="200"
align="center">
</el-table-column>
</el-table>
</div>
<loading :loading="loading">加载中...</loading>
<pagination
style="position: static;"
:page="configPage"
:total="configTotal"
@pageChange="configuraPageChange"
@pageSizeChange="configuraPageSizeChange"></pagination>
</div>
<div class="demo-drawer-footer">
<el-button type="primary" size="mini" class="common-button-primary" icon="el-icon-check" :loading="isSubmit" @click="saveConfigStand">提交</el-button>
<el-button size="mini" class="common-button-default" icon="el-icon-close" @click="cancelConfigStand">取消</el-button>
</div>
</el-drawer>
<!-- 树---新增二级菜单模态窗 -->
<el-dialog
:visible.sync="menuModalFlag"
width="500px"
:title="menuModalTitle"
destroy-on-close
:close-on-click-modal="false"
@closed="isSubmit = false"
>
<el-form ref="addMenuForm" :model="sarMenu" :rules="sarMenuRules" class="label-input-form" label-width="130px">
<el-formItem label="名称" prop="menuName" class="add-form-item">
<el-input v-model="sarMenu.menuName" placeholder="请输入名称"></el-input>
</el-formItem>
<el-formItem label="序号" prop="displaySeq" class="add-form-item">
<el-input v-model.number="sarMenu.displaySeq" placeholder="只允许输入正整数" maxlength="2"></el-input>
</el-formItem>
<el-formItem label="备注" prop="remarks" class="add-form-item">
<el-input v-model="sarMenu.remarks" placeholder="请输入备注信息"></el-input>
</el-formItem>
</el-form>
<div slot="footer" class="demo-drawer-footer">
<el-button
type="primary"
size="mini"
class="common-button-primary"
icon="el-icon-check"
:loading="isSubmit"
@click="newMenu"
>提交</el-button>
<el-button size="mini" class="common-button-default" icon="el-icon-close" @click="resetTreeDialog">取消</el-button>
</div>
</el-dialog>
<!-- 分享 -->
<el-drawer title="分享标准" :visible.sync="drawerModal" size="300px" :styles="drawerModalstyles" @close="treeCancel">
<div class="demo-drawer-content">
<dept-tree treeDivId="drawerModalTree"
ref="drawerModalTree"
@treeOnCheck="(checkedList) => treeOnCheck(checkedList)"
allDept
showUser
check-enable
:editable="false"
style="padding: 0 15px">
</dept-tree>
</div>
<div class="demo-drawer-footer">
<el-button type="primary" size="mini" class="common-button-primary" icon="el-icon-check" @click="shareStandardBt">提交</el-button>
<el-button size="mini" class="common-button-default" icon="el-icon-close" @click="treeCancel">取消</el-button>
</div>
</el-drawer>
<!-- 导入失败 -->
<el-dialog :visible.sync="importFailed" :close-on-click-modal="false" width="400px">
<p slot="title" style="color:#f60">
<span>导入失败</span>
</p>
<div style="max-height: 300px;overflow: auto;padding: 10px 0;">
<p v-html="importForm.content"></p>
</div>
<div slot="footer" class="demo-drawer-footer">
<el-button type="primary" size="mini" class="common-button-default" icon="el-icon-check" @click="importFailed = false">确认</el-button>
</div>
</el-dialog>
</div>
<!-- 分享 全部选人 -->
<org-table
:visible.sync="visibleOrgTable"
title="分享人员"
dialog-model
:config="{
value: orgTableVal,
valueName: orgTableValName
}"
@confirm="isTreeOk"
></org-table>
<loading style="z-index: 2099;" :loading="exportLoading">导入中...</loading>
</div>
</template>
<script>
import CustomInputForStandards from '@/components/CustomFormComponents/InputForStandardsForForeign'
import CustomInput from '@/components/CustomFormComponents/Input'
import CustomTextarea from '@/components/CustomFormComponents/Textarea'
import CustomSearchSelect from '@/components/CustomFormComponents/SearchSelect'
import CustomSelect from '@/components/CustomFormComponents/Select'
import CustomDatePick from '@/components/CustomFormComponents/DatePicker'
import CustomFile from '@/components/CustomFormComponents/File'
import CustomInputNum from '@/components/CustomFormComponents/InputNum'
import CustomDatePickGroup from '@/components/CustomFormComponents/DatePickerGroup'
import CustomSelectArray from '@/components/CustomFormComponents/SelectArray'
import CustomOrg from '@/components/CustomFormComponents/OrgTree'
import CustomEopDatePick from '@/components/CustomFormComponents/DatePickerWithText'
import CustomDatePickWithText, {formatText} from '@/components/CustomFormComponents/DatePickerGroupWithText'
import CustomSVPPS from '@/components/CustomFormComponents/SVPPS'
import CustomRoleTree from '@/components/CustomFormComponents/roleTree'
import CustomDatePickWithText2 from '@/components/CustomFormComponents/DatePickerWithText2'
import { interfaceUrl } from "@/sysConfig";
export default {
name: 'foreignStandardsAndRegulations',
components: {
CustomFile,
CustomInput,
CustomInputForStandards,
CustomTextarea,
CustomSearchSelect,
CustomDatePick,
CustomSelect,
CustomInputNum,
CustomDatePickGroup,
CustomSelectArray,
CustomOrg,
CustomEopDatePick,
CustomDatePickWithText,
CustomSVPPS,
CustomRoleTree,
CustomDatePickWithText2
},
data () {
return {
menuTreeLoading: true,
orderBy:'',
nowOrder:'',
visibleOrgTable: false,
orgTableVal: '',
orgTableValName: '',
exportLoading: false,
twoOptions: [],
threeOptions: [],
sarType: 'FOREIGN_STAND',
// 收藏标准
personCollect: {
collectResId: '',
collectTitle: '',
collectType: ''
},
sarStandardsSearch: {
page: 1,
pageSize: this.$store.getters.userInfo.configContent,
standType: 'INLAND',
validFlag: '0',
menuId: '',
country: '',
standNumber: '',
standName: '',
standState: '',
standNature: '',
issueTime: '',
// applyArctic: '',
replaceStandNum: '',
// replaceStandNumCope: '',
// replaceStandNumList: [],
replacedStandNum: '',
synopsis: '', // 内容摘要
// category: '', // 所属类别
standSort: '' // 标准类别
}, // 分页查询过程中用到的对象
loading: false,
isCollapse: true,
sideClose: false, // 边栏收展状态
isAdvancedSearch: false, // 高级检索窗口是否打开
replaceStandNumModel: false,
lawsExplainQuoteModel: false,
page: 1,
total: 0,
rows: 10,
replacePage: 1,
replaceTotal: 0,
replaceRows: 10,
pageItems: 1,
totalItems: 0,
itemsRows: 10,
configPage: 1,
configTotal: 0,
configRows: 10,
zNodesS: [], // 责任部门树结构
zNodesSItem: [],
searchInlandNodes: [], // 条目部门选择树形结构
// 一般检索搜索
standCommonlySearch: {
page: 1,
pageSize: this.$store.getters.userInfo.configContent,
standType: 'FOREIGN',
validFlag: '0',
standSort: '',
standNumber: '',
menuId: '',
sarStandardsSearch: ''
},
searching: false,
stahndinfoList: [],
tableFlag: '',
countryOptions: [],
regionOptions: [], // 区域
standSortOptions: [], // 标准类别下拉框
standSortConfigOptions: [], // 标准类别下拉框
applyArcticOptions: [], // 适用车型下拉框
standStateOptions: [], // 标准状态下拉框
standNatureOptions: [], // 标准性质下拉框
adoptExtentOptions: [], // 采标程度下拉框
emergyKindOptions: [], // 能源种类下拉框
applyAuthOptions: [], // 适用认证下拉框
categoryOptions: [], // 所属类别下拉框
categoryConfigOptions: [], // 所属类别下拉框
assemClassOptions: [], // 总成分类下拉框
standAttributeList: [],
// 树形结构
// tree function
MoveTest: '',
// tree setting
setting: '',
// tree zNodes
zNodes: [],
parentNode: {}, // 记录分类最外层的树结构
// ztree 拖拽标志
dragFlag: false,
defaultSarStandardsInfoEO: {
id: '',
standType: 'FOREIGN', // 标准分类
country: '',
isRelateAccess: '', // 是否添加进标准法规清单
standSort: '',
applyArctic: '',
standNumber: '',
standYear: '',
standName: '',
standEnName: '',
standState: '',
standNature: '',
replaceStandNum: '',
replacedStandNum: '',
interStandNum: '',
adoptExtent: '',
emergyKind: '',
applyAuth: '',
issueTime: '',
putTime: '',
newcarPutTime: '',
productPutTime: '',
newproductPutTime: '',
draftingUnit: '',
draftUser: '',
standFile: '',
standModifyFile: '',
draftFile: '',
opinionFile: '',
sentScreenFile: '',
approvalFile: '',
relevanceFile: '',
standFileList: [],
standModifyFileList: [],
draftFileList: [],
opinionFileList: [],
sentScreenFileList: [],
approvalFileList: [],
relevanceFileList: [],
tags: '',
synopsis: '',
responsibleUnit: '',
category: '',
remark: '',
menuId: '',
upReplaceNumFlag: 0, // 记录是否修改了代替政策编号
upNumFlag: 0,
orgName: '', // 部门名称
registerPutTime: '' // 注册登记车实施日期
}, // 标准新增过程中用到的对象
standClass: [], // 标准类别
sarStandardsInfoEO: {
FOName:'',
regionShow: '亚洲',
region: '2T8PFTSYE7',
issueUnit: '', // 发布部门
assemClass: '',
isRelateAccess: '1', // 是否添加进标准法规清单
id: '',
standType: 'FOREIGN', // 标准分类
country: '',
standSort: '',
applyArctic: '',
standNumber: '',
standYear: '',
standName: '',
standEnName: '',
standState: '',
standNature: '',
replaceStandNum: '',
replaceStandNumId: '',
// replaceStandNumCope: '',
replaceStandNumList: [],
replacedStandNum: '',
interStandNum: '',
adoptExtent: '',
emergyKind: '',
applyAuth: '',
issueTime: '',
putTime: '',
newcarPutTime: '',
productPutTime: '',
newproductPutTime: '',
draftingUnit: '',
draftUser: '',
standFile: '',
standModifyFile: '',
draftFile: '',
opinionFile: '',
sentScreenFile: '',
approvalFile: '',
relevanceFile: '',
standFileList: [],
standModifyFileList: [],
draftFileList: [],
wtoPublicFileList: [],
finalizeFileList: [],
opinionFileList: [],
sentScreenFileList: [],
approvalFileList: [],
relevanceFileList: [],
firstDraftFileList: [],
lawsExplainFileList: [],
tags: '',
synopsis: '',
responsibleUnit: '',
category: '',
remark: '',
menuId: '',
upReplaceNumFlag: 0, // 记录是否修改了代替政策编号
upNumFlag: 0,
orgName: '', // 部门名称
registerPutTime: '', // 注册登记车实施日期
standExpirationTime: '', // 标准失效日期
issueTextTime: '', // 标准发布文本获得时间(印刷版)
revisionProjectNo: '', // 标准修订立项号
recieveConfirmResult: '', // 已收到以下部门适法性确认结果
trialFirstCar: '', // 试验首款车
domainAssume: '', // 领域担当
budgetBenchmark: '', // 预算基准
planCompletionTime: '', // 制修订计划完成时间
enterNextStageTime: '', // 预测进入下制修订阶段时间
firstDraftFile: '', // 初稿
standAttribute: '', // 法规种类
isCertiStand: '', // 是否为认证标准
isNoticeApply: '', // 是否公告适用
isNationRing: '',
isNorthRing: '', // 是否北环适用
isCccApply: '', // 是否CCC适用
isEnergyStand: '', // 是否为新能源专向标准
issueTimeCm: '', // 发布日期是否明确
newcarPutTimeCm: '', // 新车型实施日期 是否明确
productPutTimeCm: '', // 在产车实施日期 是否明确
isQuestion: '', // 是否结题
draftState: '', // 参与起草情况
reviseBasis: '', // 修订依据
unProjectTime: '', // 未立项—获稿时间
projectTime: '', // 立项—获稿时间
estimatedNextTime: '', // 预计进入下一阶段时间
finalizeTime: '', // 结题时间
wtoPublicFile: '',
finalizeFile: '', // 结题附件
noticeCertPutTime: '',
cccCertPutTime: '',
nationCertPutTime: '',
northCertPutTime: '',
noticeProductPutTime: '',
cccProductPutTime: '',
nationProductPutTime: '',
northProductPutTime: '',
lawsExplainText: '',
lawsExplainKeyword: '',
lawsExplainFile: '',
lawsExplainQuote: '',
testItems: '',
lawsExplainQuoteList: [],
testItemsList: [],
firstDraftFileTime: '',
firstDraftFileFeedback: '',
wtoPublicFileTime: '',
wtoPublicFileFeedback: '',
opinionFileTime: '',
opinionFileFeedback: '',
sentScreenFileTime: '',
sentScreenFileFeedback: '',
approvalFileTime: '',
approvalFileFeedback: '',
certPutTimeList: []
}, // 标准新增过程中用到的对象
currentFileList: '', // 当前操作的是哪个FormItem的上传
isList: [
{
label: '是',
value: '1'
},
{
label: '否',
value: '2'
}
],
// 导出文件模态框控制,和文件名称
saveExportType: '',
exportModelFlag: false,
exportName: '',
standType: 'FOREIGN',
selectedList: [], // 标准中选中的数据
modalshowflag: false,
standItemEO: {
id: '',
standId: '',
itemsNum: '',
itemsName: '',
parts: '',
tackTime: '',
applyArctic: '', // 试用车型
energyKind: '', // 能源种类
responsibleUnit: '',
remarks: '',
orgName: ''
}, // 标准条目新增过程中用到对象
menuModalTitle: '',
menuModalFlag: false,
deleteMenuModal: false,
sarMenu: {
id: '',
parentId: '',
menuName: '',
sorDivide: 'FOREIGN_STAND',
displaySeq: 0,
parentIds: '',
remarks: ''
}, // 二级菜单对象,主要用于新增和修改
testItemsModel: false,
formdisableflag: false, // 查看标准不可编辑
modalshowtitle: '新增海外标准',
addOrUPdateFlag: 1, // 新增:1 修改:2
itemAddOrUPdateFlag: 1, // 新增:1 修改:2
menuAddOrUpdateFlag: 1, // 新增:1 修改:2
standNumFlag: 1, // 新增:1 修改:2
sarMenuRules: {
menuName: [
{required: true, message: '目录名称不能为空', trigger: 'blur'},
{type: 'string', max: 100, message: '目录名称不能超过100个字符', trigger: 'change'}
// {type: 'string', validator: this.verify.checkSpecialCharacter2, trigger: 'blur'}
],
displaySeq: [
{type: 'number', required: true, message: '序号不能为空且为正整数', trigger: 'change'},
{type: 'string', validator: this.verify.validStandNumInCompile2, trigger: 'blur'}
],
remarks: [
{type: 'string', max: 100, message: '备注不能超过100个字符', trigger: 'change'}
]
},
defaultAddFormFieldRules: {
standSort: [
{required: true, message: '标准类别不能为空', trigger: 'change'}
],
standNumber: [
{required: true, type: 'string', message: '标准编号不能为空', trigger: 'change'},
{type: 'string', max: 100, message: '标准编号不能超过100个字符', trigger: 'change'},
{type: 'string', validator: this.verify.validateStandardItem, trigger: 'change'}
],
synopsis: [
{type: 'string', max: 1000, message: '文本说明不能超过1000个字符', trigger: 'change'}
],
standYear: [
// {required: true, message: '标准年份/系列不能为空', trigger: 'change'},
{validator: this.verify.testItemCode, trigger: 'change'},
{type: 'string', max: 20, message: '标准年份/系列不能超过20个字符', trigger: 'change'}
],
standName: [
{required: true, message: '中文名称不能为空', trigger: 'change'},
{type: 'string', max: 500, message: '中文名称不能超过500个字符', trigger: 'change'}
],
standEnName: [
{required: true, message: '英文名称不能为空', trigger: 'change'},
{type: 'string', max: 1000, message: '英文名称不能超过1000个字符', trigger: 'change'}
// {validator: this.verify.valiateEnName, trigger: 'blur'}
],
// standState: [
// {required: true, message: '标准状态不能为空', trigger: 'change'}
// ],
replaceStandNum: [
{type: 'string', max: 100, message: '代替标准编号不能超过100个字符', trigger: 'change'}
],
isRelateAccess: [
{ required: true, message: '重要度不能为空', trigger: 'change' }
],
issueTime:[
{required: true, message: '发布日期不能为空', trigger: 'change'}
]
},
sarStandardsInfoRules: {
standSort: [
{required: true, message: '标准类别不能为空', trigger: 'change'}
],
standNumber: [
{required: true, type: 'string', message: '标准编号不能为空', trigger: 'change'},
{type: 'string', max: 100, message: '标准编号不能超过100个字符', trigger: 'change'},
{type: 'string', validator: this.verify.validateStandardItem, trigger: 'change'}
],
standYear: [
// {required: true, message: '标准年份/系列不能为空', trigger: 'change'},
{validator: this.verify.testItemCode, trigger: 'change'},
{type: 'string', max: 20, message: '标准年份/系列不能超过20个字符', trigger: 'change'}
],
standName: [
{required: true, message: '标准名称不能为空', trigger: 'change'},
{type: 'string', max: 500, message: '标准名称不能超过500个字符', trigger: 'change'}
],
standEnName: [
{type: 'string', max: 1000, message: '标准英文名称不能超过1000个字符', trigger: 'change'},
{validator: this.verify.valiateEnName, trigger: 'blur'}
],
synopsis: [
{type: 'string', max: 1000, message: '文本说明不能超过1000个字符', trigger: 'change'}
],
issueTime:[
{required: true, message: '发布日期不能为空', trigger: 'change'}
]
},
// 代替标准号
replaceStandNumForm: {
standNumber: '',
page: 1,
pageSize: this.$store.getters.userInfo.configContent,
total: 0,
standType: 'FOREIGN',
quoteIdList: '',
validFlag: '0'
},
replaceStandNumRow: [],
lawsExplainQuoteRow: [],
lawsExplainQuoteFormLoading: false,
testItemTableList: [],
testItemSearching: false,
testItemModelNum: [],
replaceStandNumModelNum: [],
lawsExplainQuoteModelNum: [],
selectedListRep: [],
quoteIdList1: '',
selectedList1: [],
selectedList2: [],
testItemsForm: {
testItemName: '',
page: 1,
pageSize: this.$store.getters.userInfo.configContent,
total: 0,
testIdList: ''
},
lawsExplainQuoteForm: {
standNumber: '',
page: 1,
pageSize: this.$store.getters.userInfo.configContent,
total: 0,
standType: 'FOREIGN',
quoteIdList: '',
validFlag: '0'
},
// 提交状态
isSubmit: false,
selectSarMenu: {}, // 用来记录当前选中的二级菜单对象
importModalshowflag: false,
showUploadlist: true, // 导入过程中新增数据时,如果数据错误,不出现导入列表
importExcelUrl: '', // 导入EXCEL文档
modalStandItemflag: false, // 标准条目显示
importFailed: false,
importForm: {
content: ''
},
standItemSearch: {
standId: '',
responsibleUnit: '',
orgName: '',
validFlag: '0'
},
standItemList: [],
drawerWidth: 1400,
// 配置标准相关 开始
configStandFlag: false, // 控制配置标准表格是否显示
// 分享数据
resType: '',
drawerModal: false, // 分享
drawerModalstyles: {
height: 'calc(100% - 55px)',
overflow: 'auto',
paddingBottom: '53px',
position: 'static'
},
// start 分享相关的
// 消息推送保存对象
personShareEO: {
id: '',
recipientId: '',
shareUserId: '',
resType: '',
resId: '',
resUri: '',
resTitle: '',
readFlag: '',
validFlag: '',
modifyTime: '',
creationTime: ''
},
// end 分享相关的
shareStandardModal: false,
shareStandardSelect: [],
resPk: '', // 分享,消息推送过程中记录要推送的标准
sarConfigStandSearch: {
page: 1,
pageSize: this.$store.getters.userInfo.configContent,
standType: 'FOREIGN',
validFlag: '0',
menuId: '',
country: '',
standSort: '',
standNumber: '',
standName: '',
standState: '',
standNature: '',
category: '',
issueTime: '',
applyArctic: '',
replaceStandNum: '',
synopsis: '',
// replaceStandNumCope: '',
replacedStandNum: ''
}, // 分页查询过程中用到的对象
configStandList: [],
configStandtotal: 0,
selectConfigStand: [],
collectBtn: false,
formFieldList: [],
reloadAddForm: false,
allSelectOptions: {},
formFieldListData: [], // 存储从接口取过来的原始数据
dynamicFormField: [],
displayLocation: [],
orgData: [],
delLoading: false,
standState: ''
}
},
props: {
},
watch: {
},
methods: {
// 树点击
isTreeOk (checkedList) {
this.shareStandardSelect = []
checkedList.map((item, index) => {
if (!item.isParent) {
this.shareStandardSelect.push(item.userId)
}
})
if (this.shareStandardSelect.length === 0) {
this.$message({
message: '请选择要分享的人!',
type: 'warning'
})
} else {
this.personShareEO.resType = 'FOREIGN_STAND'
if (this.resPk.standYear != null && this.resPk.standYear !== '') {
this.personShareEO.resTitle = this.resPk.standName + ' ( 编号:' + this.resPk.standSort + ' ' + this.resPk.standNumber + '-' + this.resPk.standYear + ' )'
} else {
this.personShareEO.resTitle = this.resPk.standName + ' ( 编号:' + this.resPk.standSort + ' ' + this.resPk.standNumber + ' )'
}
this.personShareEO.resId = this.resPk.id
this.personShareEO.recipientId = this.shareStandardSelect.join(',')
this.$http.post('/person/personShare/savePersonShare', this.personShareEO, {
_this: this
}, res => {
this.$message({
message: '标准分享成功!',
type: 'success'
})
this.shareStandardModal = false
this.visibleOrgTable = false
this.shareStandardSelect = []
// this.$refs.drawerModalTree.treeReload()
}, e => {
this.$message.error('标准分享失败!')
})
}
},
// 更多
handleCommand (command) {
switch (command[1]) {
case '收藏':
this.collectStandard(command[0])
break
case '分享':
// this.drawerModal = true
// this.$nextTick(() => {
// this.$refs.drawerModalTree.clearSearch()
// })
this.visibleOrgTable = true
this.resPk = JSON.parse(JSON.stringify(command[0]))
break
case '编辑':
this.selectStandardPro(command[0], 'edit')
break
case '删除':
this.deleteStand(1, command[0].id)
break
case '流程':
break
case '取消收藏':
this.cancelCollectStandard(command[0])
break
}
},
collectStandard (item) {
item.isSubmit = true
this.personCollect.collectResId = item.id
if (item.standYear != null && item.standYear !== '') {
this.personCollect.collectTitle = item.standName + ' ( 编号:' + item.standSort + ' ' + item.standNumber + '-' + item.standYear + ' )'
} else {
this.personCollect.collectTitle = item.standName + ' ( 编号:' + item.standSort + ' ' + item.standNumber + ' )'
}
this.personCollect.collectType = 'FOREIGN_STAND'
this.$http.postData('person/personCollect', this.personCollect, {
_this: this
}, res => {
item.isSubmit = false
if (res.ok) {
item.collectBtn = !item.collectBtn
item.cancelCollectBtn = !item.cancelCollectBtn
item.collectId = res.data.id
this.$message.success(res.message)
} else {
this.$message.warning(res.message)
}
}, e => {
item.isSubmit = false
})
},
// 取消收藏法规
cancelCollectStandard (item) {
item.isSubmit = true
this.$http.put('person/personCollect/updateByUserId', {
id: item.collectId
}, {
_this: this
}, res => {
this.$message.success('取消收藏成功')
item.isSubmit = false
item.collectBtn = !item.collectBtn
item.cancelCollectBtn = !item.cancelCollectBtn
item.collectId = ''
this.getDomesticStandardTable()
}, e => {
item.isSubmit = false
})
},
// 点击查看
handlePreview (item) {
let routeUrl = this.$router.resolve({
name: 'OtherStandardDetails',
params: {
id: item.id,
pageType: 'FOREIGN_STAND'
}
})
window.open(routeUrl.href, '_blank')
},
clickRow (row, event, column) {
let routeUrl = this.$router.resolve({
name: 'OtherStandardDetails',
params: {
id: row.id,
pageType: 'FOREIGN_STAND'
}
})
window.open(routeUrl.href, '_blank')
},
// 编辑标准属性
selectStandardPro (item, state) {
this.addOrUPdateFlag = 2
this.modalshowtitle = '编辑海外标准'
this.modalshowflag = true
this.resolveFormFieldList(item.isRelateAccess)
this.$nextTick(() => {
Promise.all([this.queryDisplayLocation()]).then((values) => {
const [displayLocation] = values
const formFieldList = this.formFieldList
this.sarStandardsInfoEO = JSON.parse(JSON.stringify(item))
this.sarStandardsInfoEO.standSort = item.standSort
if (this.sarStandardsInfoEO.putTime != null && this.sarStandardsInfoEO.putTime !== '') {
this.sarStandardsInfoEO.putTime = this.sarStandardsInfoEO.putTime.replace(new RegExp(/-/gm), '/')
this.sarStandardsInfoEO.putTime = new Date(this.sarStandardsInfoEO.putTime)
}
Object.keys(item.attrInfoMap || {}).forEach((key) => {
item.attrInfoMap[key] = item.attrInfoMap[key] === null ? '' : item.attrInfoMap[key]
if (item.attrInfoMap[key] || item.attrInfoMap[key] === '') {
this.$set(this.sarStandardsInfoEO, key, item.attrInfoMap[key])
}
})
const dynamicFormField = this.sarStandardsInfoEO
this.sarStandardsInfoEO.EOPSSRQ = this.sarStandardsInfoEO.EOPSSRQ !== 'N/A' && this.sarStandardsInfoEO.EOPSSRQ !== 'TBD' ? this.$moment(this.sarStandardsInfoEO.EOPSSRQ) : this.sarStandardsInfoEO.EOPSSRQ
this.sarStandardsInfoEO['id'] = item.id
this.standState = JSON.parse(JSON.stringify(this.sarStandardsInfoEO.standState))
formFieldList.forEach((field) => {
displayLocation.forEach((location) => {
let value = dynamicFormField[field.attrField]
let valueName = ''
if (value && field.attrType === 'DATE_PICKER') {
value = this.$moment(value).format('YYYY-MM-DD')
}
field['value'] = value
// 追加用户名称和部门名称
if (field.selVal === 'ROLELIST' || field.selVal === 'ORGLIST' || field.selVal === 'USERLIST' || field.attrField === 'SVPPS' || field.attrField === 'XMPGJS') {
let attrFieldName = field.attrField + 'Name'
valueName = dynamicFormField[attrFieldName]
}
field['valueName'] = valueName
if (field.showRegionId === location.value) {
if (!location.child) {
location['child'] = []
}
location['child'].push(field)
}
})
})
this.dynamicFormField = displayLocation
this.loading = false
})
})
},
// 二级菜单新建,编辑,删除
clickDropMenu (name, treeNode) {
this.selectSarMenu = JSON.parse(JSON.stringify(treeNode))
if (undefined !== this.selectSarMenu.id) { // 当前有选中节点
if (name === 'newMenu') {
this.menuModalTitle = '新增目录'
this.menuModalFlag = true
this.menuAddOrUpdateFlag = 1
this.sarMenu = {
id: '',
parentId: '',
menuName: '',
sorDivide: 'FOREIGN_STAND',
displaySeq: '',
parentIds: '',
remarks: ''
}
} else if (name === 'editMenu') {
this.menuModalTitle = '编辑目录'
this.menuModalFlag = true
this.menuAddOrUpdateFlag = 2
this.sarMenu.id = treeNode.id
this.sarMenu.parentId = treeNode.pId
this.sarMenu.menuName = treeNode.oldname || treeNode.name
this.sarMenu.displaySeq = treeNode.displaySeq
if (treeNode.remarks == null || treeNode.remarks === '' || treeNode.remarks === 'null') {
this.sarMenu.remarks = ''
} else {
this.sarMenu.remarks = treeNode.remarks
}
} else {
if (this.selectSarMenu.parentId == null) { // 如果父id为null 说明是根目录
this.$message({
title: '提示',
content: '根目录不可删除!'
})
} else {
// deleteMenu 删除二级菜单,先判断是否选中,选中项目,然后调用删除方法
// 先判断目录下是否有菜单
this.$http.post('lawss/sarMenu/judgequeryMenuByPid', this.selectSarMenu, {
_this: this, loading: 'loading'
}, res => {
if (res.data) {
// this.deleteMenuModal = true
this.$confirm('该节点下有记录,确定删除?', '提示', {
confirmButtonText: '确定',
confirmButtonClass: 'common-button-primary',
cancelButtonText: '取消',
type: 'warning',
roundButton: false
}).then(() => {
this.$http.post('lawss/sarMenu/deleteMenuAndChildren', this.selectSarMenu, {
_this: this, loading: 'loading'
}, res => {
this.selectMenu() // 删除成功后,更新二级菜单
// 获取下一个节点
let currentNode = this.$refs.domesticTree.getNextNode()
let nodeId = ''
// 如果这个节点为null, 本次删除了最后一个节点
if (currentNode === null) {
// 选中根节点
this.$refs.domesticTree.selectRootNode()
} else {
nodeId = currentNode.id
}
this.getDomesticStandardTable()
}, e => {
})
}).catch(() => {
// 取消删除,清空选择
// this.$refs.selections.clearSelection()
})
} else {
this.sureDeleteSarMenu()
}
}, e => {
})
}
}
} else {
this.$Modal.info({
title: '提示',
content: '请选择节点!'
})
}
},
treeClick (treeNode) {
this.selectSarMenu = treeNode // 记录当前选中的二级菜单
this.standCommonlySearch.menuId = treeNode.id
this.standCommonlySearch.page = 1
this.getDomesticStandardTable() // 根据选中的二级菜单查询对应的标准列表
},
treeRightClick (treeNode) {
this.selectSarMenu = treeNode // 记录当前选中的二级菜单
this.standCommonlySearch.menuId = treeNode.id
},
// 点击搜索按钮
searchBtnClick () {
this.getDomesticStandardTable()
},
// 搜索
getDomesticStandardTableBtn (sarStandardsSearch) {
this.standCommonlySearch.page = 1
this.standCommonlySearch.sarStandardsSearch = JSON.stringify(sarStandardsSearch) || ''
this.getDomesticStandardTable(2)
},
// 清空搜索框
clearAllSearch (flag) {
if (flag === 'standCommonlySearch') {
this.standCommonlySearch.standSort = ''
this.standCommonlySearch.standNumber = ''
this.standCommonlySearch.page = 1
this.getDomesticStandardTable()
} else if (flag === 2) {
// 标准条目搜索
this.standItemSearch.responsibleUnit = ''
this.standItemSearch.orgName = ''
} else {
this.configPage = 1
// 游离标准搜索清空
this.sarConfigStandSearch.standSort = ''
this.sarConfigStandSearch.standNumber = ''
this.sarConfigStandSearch.standName = ''
this.sarConfigStandSearch.category = ''
this.sarConfigStandSearch.standNature = ''
this.sarConfigStandSearch.synopsis = ''
this.sarConfigStandSearch.applyArctic = ''
this.sarConfigStandSearch.replaceStandNum = ''
this.selectConfiguraStand()
}
},
// 高级检索
selectMoreBtn () {
this.isAdvancedSearch = true
},
treeCollapse () {
this.sideClose = !this.sideClose
},
// 收展按钮
collapseIcon () {
return this.sideClose ? 'el-icon-arrow-left' : 'el-icon-arrow-right'
// return 'el-icon-arrow-left'
},
resetTreeDialog () {
this.menuModalFlag = false
this.$refs['addMenuForm'].resetFields()
},
// 点击二级菜单新增模态框中的保存
newMenu () {
this.isSubmit = true
this.$refs['addMenuForm'].validate((valid) => {
if (valid) {
if (this.menuAddOrUpdateFlag === 1) {
this.sarMenu.parentId = this.selectSarMenu.id
if (this.selectSarMenu.parentIds != null) {
this.sarMenu.parentIds = this.selectSarMenu.parentIds + ',' + this.selectSarMenu.id
} else {
this.sarMenu.parentIds = this.selectSarMenu.id
}
this.$http.post('lawss/sarMenu/addSarMenu', this.sarMenu, {
_this: this
}, res => {
this.selectMenu() // 新增成功后,更新二级菜单
this.menuModalFlag = false
}, e => {
})
} else {
this.$http.post('lawss/sarMenu/updateSarMenu', this.sarMenu, {
_this: this
}, res => {
this.selectMenu() // 修改成功后,更新二级菜单
this.selectSarMenu = res.data
this.menuModalFlag = false
}, e => {
})
}
} else {
this.$message.warning('请检查表单是否填写正确')
this.isSubmit = false
}
})
},
// 查询二级菜单
selectMenu () {
return new Promise((resolve, reject) => {
this.$http.get('lawss/sarMenu/selectMenuByRole', {sorDivide: 'FOREIGN_STAND'}, {
_this: this
}, res => {
let treeNode = []
this.parentNode = {}
res.data.forEach((item, index) => {
let treeItem = {}
for (let key in item) {
if (key === 'parentId') {
treeItem.pId = item[key]
treeItem.parentId = item[key]
} else if (key === 'menuName') {
treeItem.name = item[key]
} else {
treeItem[key] = item[key]
}
if (this.initZNode === '' && item.id === '64df1d5522bb49c09af2') { this.initZNode = treeItem }
}
treeNode[index] = treeItem
// 记录最外层父节点
if (treeItem.parentId === '' || treeItem.parentId == null) {
this.parentNode = treeItem
}
})
this.zNodes = treeNode
// 查完左侧目录后,如果没有选中的,设置最外层选中
if (JSON.stringify(this.selectSarMenu) === '{}' || !this.selectSarMenu) {
this.selectSarMenu = JSON.parse(JSON.stringify(this.parentNode))
}
resolve(res)
}, e => {
reject(e)
})
})
},
// 树-删除
sureDeleteSarMenu () {
this.$confirm('是否删除?', '提示', {
confirmButtonText: '确定',
confirmButtonClass: 'common-button-primary',
cancelButtonText: '取消',
roundButton: false,
type: 'warning'
}).then(() => {
this.$http.post('lawss/sarMenu/deleteMenuAndChildren', this.selectSarMenu, {
_this: this, loading: 'loading'
}, res => {
this.selectMenu() // 删除成功后,更新二级菜单
// 获取下一个节点
let currentNode = this.$refs.domesticTree.getNextNode()
let nodeId = ''
// 如果这个节点为null, 本次删除了最后一个节点
if (currentNode === null) {
// 选中根节点
this.$refs.domesticTree.selectRootNode()
} else {
nodeId = currentNode.id
}
this.getDomesticStandardTable()
}, e => {
})
}).catch(() => {
// 取消删除,清空选择
// this.$refs.selections.clearSelection()
})
},
// 树点击
treeOnCheck (checkedList) {
this.shareStandardSelect = []
checkedList.map((item, index) => {
if (!item.isParent) {
this.shareStandardSelect.push(item.id)
}
})
},
// 取消
treeCancel () {
this.drawerModal = false
this.$refs.drawerModalTree.treeReload()
},
// 消息推送
shareStandardBt () {
if (this.shareStandardSelect.length === 0) {
this.$message({
message: '请选择要分享的人!',
type: 'warning'
})
} else {
this.personShareEO.resType = 'FOREIGN_STAND'
if (this.resPk.standYear != null && this.resPk.standYear !== '') {
this.personShareEO.resTitle = this.resPk.standName + ' ( 编号:' + this.resPk.standSort + ' ' + this.resPk.standNumber + '-' + this.resPk.standYear + ' )'
} else {
this.personShareEO.resTitle = this.resPk.standName + ' ( 编号:' + this.resPk.standSort + ' ' + this.resPk.standNumber + ' )'
}
this.personShareEO.resId = this.resPk.id
this.personShareEO.recipientId = this.shareStandardSelect.join(',')
this.$http.post('/person/personShare/savePersonShare', this.personShareEO, {
_this: this
}, res => {
this.$message({
message: '标准分享成功!',
type: 'success'
})
this.shareStandardModal = false
this.drawerModal = false
this.shareStandardSelect = []
this.$refs.drawerModalTree.treeReload()
}, e => {
this.$message.error('标准分享失败!')
})
}
},
// 导出选中的标准 此处因为复选框没有设置好,所以先设置导出所有数据
exportStandard () {
// 区别是选择导出还是全部导出
// this.exportModelFlag = true
if (this.selectedList.length > 0) {
this.saveExportType = 'apart'
} else {
this.saveExportType = 'all'
}
// if (type === 'apart') {
// if (this.selectedList.length > 0) {
// this.exportName = ''
// this.exportModelFlag = true
// } else {
// this.$message({
// message: '请先选择要导出的数据',
// type: 'warning'
// })
// }
// } else {
// }
this.exportName = ''
this.exportModelFlag = true
},
// 获取拖拽行的id
dragRowClassName (row, index) {
return 'drag-row' + ' ' + 'id=' + row.row.id
},
// 拖拽事件
drag (treeNode, dragId) {
if (treeNode !== null) {
let search = {
menuId: treeNode.id,
idlist: this.selectedList.length ? this.selectedList : dragId
}
this.$http.postData('sarStandardsInfo/sar-standards-info/saveStandardsMenu', search, {
_this: this
}, res => {
if (res.ok) {
this.$message({
message: '操作成功',
type: 'success'
})
this.getDomesticStandardTable(this.tableFlag)
} else {
this.$message({
message: res.message,
type: 'warning'
})
}
}, e => {
})
}
},
// 修改成表格样式后,选择项勾选改变
standSelectChange (data) {
this.selectedList = []
for (let i = 0; i < data.length; i++) {
this.selectedList.push(data[i].id)
}
},
// 导出确定功能
exportTestItem () {
if (this.saveExportType === 'apart') {
if (this.selectedList != null && this.selectedList !== '') {
const exportURL = interfaceUrl + 'sarStandardsInfo/sar-standards-info/exportStandardsInfoExcel?' +
'exportType' + this.saveExportType + '&exportContent=' + this.selectedList.join(',') + '&exportName=' + this.exportName + '&standType=' + this.standType
window.open(exportURL)
this.$message.success('导出信息成功')
}
} else if (this.saveExportType === 'all') {
let exportEOStr = JSON.stringify(this.SarExportSearchEo)
exportEOStr = exportEOStr.replace(/""/g, null)
window.open('/api/lawss/sarStandardsInfo/exportStandardsInfoExcel?exportType=' + this.saveExportType + '&exportContent=' + exportEOStr + '&exportName=' + this.exportName + '&standType=' + this.standType)
this.$message.success('导出信息成功')
}
this.exportModelFlag = false
},
// 导出取消按钮关闭模态、置空
cancal () {
this.exportModelFlag = false
},
// 点击新增按钮弹出新增模态框
addModal () {
this.getMenu().then(boolean => {
if (boolean) {
// 判断是否有缓存的数据
const item = JSON.parse(sessionStorage.getItem('FOREIGN_INLAND'))
this.sarStandardsInfoEO = item ? item : {...this.defaultSarStandardsInfoEO}
this.sarStandardsInfoEO.menuId = this.selectSarMenu.id
this.sarStandardsInfoEO.isRelateAccess = '1'
this.modalshowflag = true
this.formdisableflag = false
this.modalshowtitle = '新增海外标准'
this.addOrUPdateFlag = 1
this.standNumFlag = 1
this.$nextTick(() => {
// this.$refs['sarStandardsInfoForm'].resetFields()
})
this.getOrgTreeSource()
this.resolveFormFieldList()
Promise.all([this.queryDisplayLocation()]).then((values) => {
const [displayLocation] = values
const dynamicFormField = this.sarStandardsInfoEO
const formFieldList = this.formFieldList
formFieldList.forEach((field) => {
displayLocation.forEach((location) => {
let value = dynamicFormField[field.attrField]
if (value && typeof value === 'number') {
value = this.$dateFormat(value, 'yyyy-MM-dd')
}
field['value'] = value
// 法规维护人追加默认值
if (field.attrField === 'FGWHR') {
field['value'] = this.$store.getters.userInfo.userId
field['valueName'] = this.$store.getters.userInfo.uName
}
if (field.showRegionId === location.value) {
if (!location.child) {
location['child'] = []
}
location['child'].push(field)
}
})
})
this.dynamicFormField = displayLocation
this.sarStandardsInfoEO.FGWHR = this.$store.getters.userInfo.userId
this.sarStandardsInfoEO.EOPSSRQ = 'N/A'
this.sarStandardsInfoEO.XCXSSRQ = 'N/A'
this.sarStandardsInfoEO.ZCCSSRQ = 'N/A'
this.loading = false
})
}
})
},
testItemsClick () {
// if (this.testItemsModel) {
// return false
// }
this.testItemsModel = true
// $('#testItems').click()
// this.selectedList2 = []
// this.$refs.selection2.selectAll(false)
this.testItemsForm.testItemName = ''
this.getTestItemRow('')
},
beforeUploadTop (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 !== '.zip' && fileSuffix !== '.ZIP') {
this.$message.error('文件' + file.name + '格式不正确,请上传zip文件')
return false
}
// 判断文件上传大小
if (file.size / 1024 / 1024 > 200) {// eslint-disable-line
this.$message.error('文件' + file.name + '大小不超过200M')
return false
}
return true
},
// 删除数组中的某个对象
removeAaary (_arr, _obj) {
var length = _arr.length
for (var i = 0; i < length; i++) {
if (_arr[i] === _obj) {
if (i === 0) {
_arr.shift() // 删除并返回数组的第一个元素
return _arr
} else if (i === length - 1) {
_arr.pop() // 删除并返回数组的最后一个元素
return _arr
} else {
_arr.splice(i, 1) // 删除下标为i的元素
return _arr
}
}
}
},
handleAddFormatError (file) {
// this.$message.error('文件' + file.name + '格式不正确,请上传pdf、doc、docx、ppt、pptx文件')
this.$message({
showClose: true,
message: '文件' + file.name + '格式不正确,请上传pdf、doc、docx、ppt、pptx文件',
type: 'error'
})
},
// 导入文件大小超出范围
handleSizeError (file) {
this.$message({
showClose: true,
message: '文件' + file.name + '大小不超过200M',
type: 'error'
})
},
// 删除标准
deleteStand (flag, itemid) {
if (flag === 1) {
(
this.$confirm('确认删除这些数据?', '提示', {
confirmButtonText: '确定',
confirmButtonClass: 'common-button-primary',
cancelButtonText: '取消',
type: 'warning',
roundButton: false
}).then(() => {
this.$http.post('sarStandardsInfo/sar-standards-info/deleteSarStandards', {ids: itemid}, {
_this: this,
loading: 'delLoading'
}, res => {
this.getDomesticStandardTable(this.tableFlag)
this.selectedList = []
}, e => {
})
}).catch(() => {
// 取消删除,清空选择
this.$refs.multipleTable.clearSelection()
})
)
} else {
if (this.selectedList.length === 0) {
this.$confirm('请选择一条数据进行删除', '提示', {
showCancelButton: false,
confirmButtonText: '确定',
confirmButtonClass: 'common-button-primary',
cancelButtonText: '取消',
roundButton: false,
type: 'warning'
})
} else {
(
this.$confirm('确认删除这些数据?', '提示', {
confirmButtonText: '确定',
confirmButtonClass: 'common-button-primary',
cancelButtonText: '取消',
roundButton: false,
type: 'warning'
}).then(() => {
this.$http.post('sarStandardsInfo/sar-standards-info/deleteSarStandards', {ids: this.selectedList.join(',')}, {
_this: this
}, res => {
this.getDomesticStandardTable(this.tableFlag)
this.selectedList = []
}, e => {
})
}).catch(() => {
// 取消删除,清空选择
this.$refs.multipleTable.clearSelection()
})
)
}
}
},
// 模板下载
uploadImportModal (flag) {
window.open('/api/sarStandardsInfo/sar-standards-info/exportTemplate?standType=FOREIGN')
// if (flag === 1) {
// } else {
// window.open('/api/lawss/sarStandardsInfo/exportTemplate?fileName=标准条目导入模板.xlsx')
// }
},
// 点击导入标准
addImportModal (flag) {
this.getMenu().then(boolean => {
if (boolean) {
// this.$refs.importfile.clearFiles()
if (flag === 1) {
let menuId = this.selectSarMenu.id
if (menuId == null || menuId === '') {
this.$message({
showClose: true,
message: '请选择标准导入的目录',
type: 'error'
})
} else {
this.importModalshowflag = true
this.showUploadlist = true
this.importExcelUrl = '/api/sarStandardsInfo/sar-standards-info/importZipStandardsInfo?standType=FOREIGN&menuId=' + menuId
}
} else {
this.importModalshowflag = true
this.importExcelUrl = '/api/lawss/sarStandItems/importSarStandItemsList?standId=' + this.standItemSearch.standId
}
}
})
},
handleClose (done) {
this.$confirm('确认关闭?')
.then(_ => {
done()
})
.catch(_ => {})
},
// 表单清空
resetForm () {
this.modalshowflag = false
this.$refs['sarStandardsInfoForm'].resetFields()
},
// 标准号验证
validateStandNumber (standInfo) {
return new Promise((resolve, reject) => {
let obj = JSON.parse(JSON.stringify(standInfo))
this.$http.post('sarStandardsInfo/sar-standards-info/validateStandNumber', obj, {
_this: this
}, res => {
if (res.ok) {
resolve(true)
} else {
resolve(false)
}
}, e => {
reject(e)
})
})
},
/**
* 保存新增标准数据召浏览器缓存
* */
saveBt () {
sessionStorage.setItem('FOREIGN_INLAND', JSON.stringify(this.sarStandardsInfoEO))
this.$message.success('保存成功')
},
// 保存或修改标准
saveOrUpdateStands () {
this.$refs['sarStandardsInfoForm'].validate((valid) => {
if (valid) {
// 验证标准号是否唯一
this.validateStandNumber(this.sarStandardsInfoEO).then((flag) => {
if (flag) {
// 时间格式修改
let nowstandinfo = JSON.parse(JSON.stringify(this.sarStandardsInfoEO))
// if (nowstandinfo.issueTime != null && nowstandinfo.issueTime !== '') {
// nowstandinfo.issueTime = this.$moment(this.sarStandardsInfoEO.issueTime).format('YYYY-MM-DD')
// }
if (nowstandinfo.putTime != null && nowstandinfo.putTime !== '') {
nowstandinfo.putTime = this.$dateFormat(this.sarStandardsInfoEO.putTime, 'yyyy-MM-dd hh:mm:ss')
}
// 代替标准号
if (nowstandinfo.replaceStandNum != null) {
nowstandinfo.replaceStandNum = nowstandinfo.replaceStandNum.replace(//ig, ',')
}
if (nowstandinfo.replaceStandNum != null && nowstandinfo.replaceStandNum !== '') {
nowstandinfo.replaceStandNum = nowstandinfo.replaceStandNum.replace(/\r\n/g, '<br />')
nowstandinfo.replaceStandNum = nowstandinfo.replaceStandNum === '' ? '' : nowstandinfo.replaceStandNum.replace(/\n/g, '<br />')
}
// 处理动态表单的时间和下拉框格式
const formFieldList = this.formFieldList
const sarStandAttrObj = {}
formFieldList.forEach((item) => {
const value = nowstandinfo[item.attrField]
// 时间格式处理
if (item.attrType === 'DATE_PICKER' && value) {
nowstandinfo[item.attrField] = this.$dateFormat(this.sarStandardsInfoEO[item.attrField], 'yyyy-MM-dd hh:mm:ss')
}
// 数组处理
if (item.attrType === 'SEL_OPTION' || item.attrType === 'SEL_OPTS') {
if (value != null && (value instanceof Array)) {
nowstandinfo[item.attrField] = nowstandinfo[item.attrField].join(',')
}
}
sarStandAttrObj[item.attrField] = nowstandinfo[item.attrField]
})
nowstandinfo['sarStandAttrEOStr'] = JSON.stringify(sarStandAttrObj).replace(/"/g, "'")
// 判断三个实施日期不能全部未N/A和TBD
// if ((nowstandinfo.EOPSSRQ === 'N/A' || nowstandinfo.EOPSSRQ === 'TBD' || nowstandinfo.EOPSSRQ === '已实施') &&
// (nowstandinfo.XCXSSRQ === 'N/A' || nowstandinfo.XCXSSRQ === 'TBD' || nowstandinfo.XCXSSRQ === '已实施') &&
// (nowstandinfo.ZCCSSRQ === 'N/A' || nowstandinfo.ZCCSSRQ === 'TBD' || nowstandinfo.ZCCSSRQ === '已实施')) {
// this.isSubmit = false
// return this.$message.warning('实施日期必须有一项为日期格式')
// }
this.isSubmit = true
this.$http.postData(this.addOrUPdateFlag === 1 ? 'lawss/sarStandardsInfo/addarStandardsInfo' : 'lawss/sarStandardsInfo/updateSarStandardsInfo', nowstandinfo, {
_this: this
}, res => {
this.isSubmit = false
if (res.ok) {
this.getDomesticStandardTable(this.tableFlag)
this.resetForm()
if (this.addOrUPdateFlag === 1) {
sessionStorage.removeItem('FOREIGN_INLAND')
}
}
}, e => {
this.isSubmit = false
})
} else {
this.isSubmit = false
}
}, e => {})
} else {
this.isSubmit = false
this.$message({
message: '请检查表单是否填写正确',
type: 'warning'
})
}
})
},
// 表格排序
sortChange (sortObj) {
if (sortObj.column.order !== 'normal') {
this.nowOrder = ''
this.orderBy = ''
switch (sortObj.column.property) {
case 'issueTime' :
// 后台联调
this.orderBy = 1;
this.nowOrder = sortObj.column.order
if (this.nowOrder === 'ascending'){
this.nowOrder=2
}else if (this.nowOrder === 'descending') {
this.nowOrder=1
}
break
case 'XCXSSRQ' :
this.orderBy = 2;
this.nowOrder = sortObj.column.order
if (this.nowOrder === 'ascending'){
this.nowOrder=2
}else if (this.nowOrder === 'descending') {
this.nowOrder=1
}
break
case 'ZCCSSRQ' :
this.orderBy = 3;
this.nowOrder = sortObj.column.order
if (this.nowOrder === 'ascending'){
this.nowOrder=2
}else if (this.nowOrder === 'descending') {
this.nowOrder=1
}
break
case 'standStateShow' :
this.orderBy = 5;
this.nowOrder = sortObj.column.order
if (this.nowOrder === 'ascending'){
this.nowOrder=2
}else if (this.nowOrder === 'descending') {
this.nowOrder=1
}
break
}
}
this.getDomesticStandardTable()
},
// 分页点击后方法
pageChange (page) {
this.standCommonlySearch.page = page
this.getDomesticStandardTable()
},
// 分页每页显示数改变后方法
pageSizeChange (pageSize) {
this.standCommonlySearch.pageSize = pageSize
this.standCommonlySearch.page = 1
this.getDomesticStandardTable()
},
/**
* // 分页查询标准
* item 判断是高级检索还是普通检索
* 1、空:普通检索 2:高级检索
* */
getDomesticStandardTable (item) {
let data = this.standCommonlySearch
if (item === 2) {
data.standSort = ''
data.standNumber = ''
} else {
data.sarStandardsSearch = ''
}
const formData = {...data}
formData.menuId = this.selectSarMenu.id
formData.nowOrderBy = this.nowOrder ? this.orderBy : ''
formData.nowOrder = this.nowOrder
// 处理我的收藏和个性化标签传参
if (this.selectSarMenu.id === 'wdsc') {
formData.menuId = undefined
formData.labelMenuId = undefined
formData.collectMenuId = 'wdsc'
} else if (this.selectSarMenu.id === 'gxhbq' || this.selectSarMenu.pId === 'gxhbq') {
formData.menuId = undefined
formData.labelMenuId = this.selectSarMenu.id
formData.collectMenuId = undefined
} else {
formData.labelMenuId = undefined
formData.collectMenuId = undefined
}
formData.standType = 'FOREIGN'
this.SarExportSearchEo = formData
this.$http.get('sarStandardsInfo/sar-standards-info/getSarStandardsInfoPage', formData, {
_this: this, loading: 'loading'
}, res => {
console.log('2441',formData);
this.isAdvancedSearch = false
if (res.ok) {
for (let i = 0; i < res.data.list.length; i++) {
res.data.list[i].checked = false
if (res.data.list[i].collectId != null && res.data.list[i].collectId !== '') {
res.data.list[i].collectBtn = false
res.data.list[i].cancelCollectBtn = true
} else {
res.data.list[i].collectBtn = true
res.data.list[i].cancelCollectBtn = false
}
res.data.list[i].isSubmit = false
if (res.data.list[i].attrInfoMap && res.data.list[i].attrInfoMap.XCXSSRQ) {
res.data.list[i].XCXSSRQ = res.data.list[i].attrInfoMap.XCXSSRQ.split(',')[0]
}
if (res.data.list[i].attrInfoMap && res.data.list[i].attrInfoMap.ZCCSSRQ) {
res.data.list[i].ZCCSSRQ = res.data.list[i].attrInfoMap.ZCCSSRQ.split(',')[0]
}
}
this.stahndinfoList = res.data.list
this.total = res.data.count
} else {
this.$message.error(res.message)
}
}, e => {
this.stahndinfoList = []
this.total = 0
})
},
// 查询处于游离态的标准
selectConfiguraStand () {
this.sarConfigStandSearch.page = this.configPage
// this.sarConfigStandSearch.pageSize = this.configRows
this.sarConfigStandSearch.pageSize = this.$store.getters.userInfo.configContent
this.$http.get('sarStandardsInfo/sar-standards-info/getSarStandardsInfoPage', this.sarConfigStandSearch, {
_this: this,
loading: 'loading'
}, res => {
for (let i = 0; i < res.data.list.length; i++) {
if (res.data.list[i].attrInfoMap && res.data.list[i].attrInfoMap.XCXSSRQ) {
res.data.list[i].XCXSSRQ = res.data.list[i].attrInfoMap.XCXSSRQ.split(',')[0]
}
}
this.configStandList = res.data.list
this.configTotal = res.data.count
this.selectConfigStand = []
}, e => {
})
},
// 获取组织机构数据
getOrgTreeSource () {
this.$http.get('sys/org/getTree', {}, {
_this: this
},
res => {
if (res.ok) {
let treeNode = []
res.data.forEach((item, index) => {
let treeItem = {}
for (let key in item) {
if (key === 'orgName') {
treeItem.name = item[key]
} else {
treeItem[key] = item[key]
}
}
treeNode[index] = treeItem
})
this.zNodesS = JSON.parse(JSON.stringify(treeNode))
this.zNodesSItem = JSON.parse(JSON.stringify(treeNode))
this.searchInlandNodes = JSON.parse(JSON.stringify(treeNode))
}
}, e => {})
},
// 所属部门选取
treeDblClick (treeId, treeNode) {
this.sarStandardsInfoEO.responsibleUnit = treeNode.id
this.sarStandardsInfoEO.orgName = treeNode.name
$('#deptBtn').click()
},
inputChange () {
this.modalshowflag = true
},
// 代替标准号搜索
selectStands () {
// if (this.standNumFlag === 1) {
// this.$refs.selections.selectAll(false)
// }
this.sarStandardsInfoEO.replaceStandNum = ''
this.replaceStandNumModel = true
this.getReplaceStandNumRow('')
},
selectReplaceStandNumRowChange (row) {
this.replaceStandNumModelNum = row
},
selectLawsExplainQuoteRowChange (row) {
this.lawsExplainQuoteModelNum = row
},
// 试验项目
selectTestItemRowChange (row) {
this.testItemModelNum = row
},
selectTestItemRowSelect (selection, flag, row) {
let index = ''
if (row) {
this.selectedList2.map((item, rowIndex) => {
if (row.id === item.id) {
index = rowIndex
}
})
}
if (flag === 'select') {
this.selectedList2.push(row)
const newobj = {}
this.selectedList2 = this.selectedList2.reduce((preVal, curVal) => {
newobj[curVal.id] ? '' : newobj[curVal.id] = preVal.push(curVal) // eslint-disable-line
return preVal
}, [])
}
if (flag === 'cancel') {
this.selectedList2.splice(index, 1)
}
if (flag === 'all') {
selection.map((item) => {
this.selectedList2.push(item)
})
const newobj = {}
this.selectedList2 = this.selectedList2.reduce((preVal, curVal) => {
newobj[curVal.id] ? '' : newobj[curVal.id] = preVal.push(curVal) // eslint-disable-line
return preVal
}, [])
}
if (flag === 'allCancel') {
this.testItemTableList.map((item) => {
this.selectedList2.map((list, index) => {
if (item.id === list.id) {
this.selectedList2.splice(index, 1)
}
})
})
}
},
selectLawsExplainQuoteRowSelect (selection, flag, row) {
let index = ''
if (row) {
this.selectedList1.map((item, rowIndex) => {
if (row.id === item.id) {
index = rowIndex
}
})
}
if (flag === 'select') {
this.selectedList1.push(row)
const newobj = {}
this.selectedList1 = this.selectedList1.reduce((preVal, curVal) => {
newobj[curVal.id] ? '' : newobj[curVal.id] = preVal.push(curVal) // eslint-disable-line
return preVal
}, [])
}
if (flag === 'cancel') {
this.selectedList1.splice(index, 1)
}
if (flag === 'all') {
selection.map((item) => {
this.selectedList1.push(item)
})
const newobj = {}
this.selectedList1 = this.selectedList1.reduce((preVal, curVal) => {
newobj[curVal.id] ? '' : newobj[curVal.id] = preVal.push(curVal) // eslint-disable-line
return preVal
}, [])
}
if (flag === 'allCancel') {
this.lawsExplainQuoteRow.map((item) => {
this.selectedList1.map((list, index) => {
if (item.id === list.id) {
this.selectedList1.splice(index, 1)
}
})
})
}
},
// 代替标准号
getReplaceStandNumRow (page = 1, pageSize = this.$store.getters.userInfo.configContent) {
this.replaceStandNumForm.page = this.replacePage
this.replaceStandNumForm.pageSize = this.$store.getters.userInfo.configContent
if (page === '') {
this.replaceStandNumForm.page = 1
this.replaceStandNumForm.standNumber = ''
}
// this.replaceStandNumForm.quoteIdList = this.quoteIdList1.toString() === '' ? '' : this.quoteIdList1
if (this.sarStandardsInfoEO.replaceStandNum !== null && this.sarStandardsInfoEO.replaceStandNum !== '') {
this.replaceStandNumForm.quoteIdList = this.quoteIdList1.toString() === '' ? '' : this.quoteIdList1
} else {
this.quoteIdList1 = []
this.replaceStandNumForm.quoteIdList = ''
}
// if (this.sarStandardsInfoEO.replaceStandNumId !== null && this.sarStandardsInfoEO.replaceStandNumId !== '') {
// this.replaceStandNumForm.quoteIdList = this.sarStandardsInfoEO.replaceStandNumId.toString()
// (this.replaceStandNumForm.quoteIdList)
// }
this.$http.get('sarStandardsInfo/sar-standards-info/getSarStandardsInfoPage', this.replaceStandNumForm, {
_this: this
// loading: 'lawsExplainQuoteFormLoading'
}, res => {
this.replaceStandNumRow = res.data.list
this.replaceTotal = res.data.count
if (this.selectedListRep.length !== 0) {
this.selectedListRep.map((list) => {
this.replaceStandNumRow.map((item) => {
if (list.id === item.id) {
item._checked = true
}
})
})
}
}, e => {
})
},
/**
*@desc:代替标准号
*@author: zhangRui
*@time: 2020/08/25 11:52:47
*/
selectReplaceStandNumRowSelect (selection, flag, row) {
let index = ''
if (row) {
this.selectedListRep.map((item, rowIndex) => {
if (row.id === item.id) {
index = rowIndex
}
})
}
if (flag === 'select') {
this.selectedListRep.push(row)
const newobj = {}
this.selectedListRep = this.selectedListRep.reduce((preVal, curVal) => {
newobj[curVal.id] ? '' : newobj[curVal.id] = preVal.push(curVal) // eslint-disable-line
return preVal
}, [])
}
if (flag === 'cancel') {
this.selectedListRep.splice(index, 1)
}
if (flag === 'all') {
selection.map((item) => {
this.selectedListRep.push(item)
})
const newobj = {}
this.selectedListRep = this.selectedListRep.reduce((preVal, curVal) => {
newobj[curVal.id] ? '' : newobj[curVal.id] = preVal.push(curVal) // eslint-disable-line
return preVal
}, [])
}
if (flag === 'allCancel') {
this.replaceStandNumRow.map((item) => {
this.selectedListRep.map((list, index) => {
if (item.id === list.id) {
this.selectedListRep.splice(index, 1)
}
})
})
}
},
lawsExplainQuoteModelBt () {
if (typeof this.sarStandardsInfoEO.lawsExplainQuote === 'string') {
this.sarStandardsInfoEO.lawsExplainQuote = this.sarStandardsInfoEO.lawsExplainQuote.split('')
}
if (this.sarStandardsInfoEO.lawsExplainQuote === null) {
this.sarStandardsInfoEO.lawsExplainQuote = []
}
if (this.selectedList1.length === 0) {
// return this.$Message.warning('请先选择数据')
return this.$message({
message: '请先选择数据',
type: 'warning'
})
}
if (this.selectedList1.length + this.sarStandardsInfoEO.lawsExplainQuote.length > 20) {
// return this.$Message.warning('法规解读标准引用最多选择20项')
return this.$message({
message: '法规解读标准引用最多选择20项',
type: 'warning'
})
}
this.selectedList1.map((item) => {
let texts = ''
if (item.standYear != null && item.standYear !== '') {
texts = item.standSortShow + ' ' + item.standNumber + '-' + item.standYear
} else {
texts = item.standSortShow + ' ' + item.standNumber
}
if (this.sarStandardsInfoEO.lawsExplainQuoteList === null) {
this.sarStandardsInfoEO.lawsExplainQuoteList = []
}
this.sarStandardsInfoEO.lawsExplainQuoteList.push({
label: texts,
value: item.id
})
// ('this.sarStandardsInfoEO.lawsExplainQuoteList', this.sarStandardsInfoEO.lawsExplainQuoteList)
this.sarStandardsInfoEO.lawsExplainQuote.push(item.id)
this.sarStandardsInfoEO.lawsExplainQuote = [...new Set(this.sarStandardsInfoEO.lawsExplainQuote)]
this.lawsExplainQuoteModel = false
})
},
canle () {
this.lawsExplainQuoteModel = false
},
// 法规解读标准引用
lawsExplainQuoteClick () {
this.getLawsExplainQuoteRow('')
this.lawsExplainQuoteModel = true
if (this.lawsExplainQuoteModel) {
return false
}
this.lawsExplainQuoteModel = true
$('#lawsExplainQuote').click()
this.selectedList1 = []
// this.$refs.selection.selectAll(false)
this.testItemsForm.standNumber = ''
},
pageChangeLaws (page) {
this.page = page
this.getLawsExplainQuoteRow()
},
pageSizeChangeLaws (pageSize) {
this.rows = pageSize
this.getLawsExplainQuoteRow()
},
// 法规分页
pageChangeReplace (page) {
this.replacePage = page
this.getReplaceStandNumRow()
},
pageSizeChangeReplace (pageSize) {
this.replaceRows = pageSize
this.getReplaceStandNumRow()
},
// 试验项目分页
pageChangeItems (page) {
this.pageItems = page
this.getTestItemRow()
},
pageSizeChangeItems (pageSize) {
this.itemsRows = pageSize
this.getTestItemRow()
},
testItemsModellBt () {
if (this.selectedList2.length === 0) {
return this.$message({
message: '请先选择数据',
type: 'warning'
})
}
if (typeof this.sarStandardsInfoEO.testItems === 'string') {
this.sarStandardsInfoEO.testItems = this.sarStandardsInfoEO.testItems.split('')
}
if (this.sarStandardsInfoEO.testItems === null) {
this.sarStandardsInfoEO.testItems = []
}
if (this.selectedList2.length + this.sarStandardsInfoEO.testItems.length > 20) {
return this.$message({
message: '试验项目最多选择20项',
type: 'warning'
})
}
this.selectedList2.map((item) => {
if (this.sarStandardsInfoEO.testItemsList === null) {
this.sarStandardsInfoEO.testItemsList = []
}
this.sarStandardsInfoEO.testItemsList.push({
label: item.testItemName,
value: item.id
})
this.sarStandardsInfoEO.testItems.push(item.id)
this.sarStandardsInfoEO.testItems = [...new Set(this.sarStandardsInfoEO.testItems)]
this.testItemsModel = false
})
},
getLawsExplainQuoteRow (page = 1, pageSize = this.$store.getters.userInfo.configContent) {
this.lawsExplainQuoteForm.page = this.page
this.lawsExplainQuoteForm.pageSize = this.$store.getters.userInfo.configContent
if (page === '') {
this.lawsExplainQuoteForm.page = 1
this.lawsExplainQuoteForm.standNumber = ''
}
if (this.sarStandardsInfoEO.lawsExplainQuote !== null && this.sarStandardsInfoEO.lawsExplainQuote !== '') {
this.lawsExplainQuoteForm.quoteIdList = this.sarStandardsInfoEO.lawsExplainQuote.toString()
}
this.$http.get('sarStandardsInfo/sar-standards-info/getSarStandardsInfoPage', this.lawsExplainQuoteForm, {
_this: this,
loading: 'lawsExplainQuoteFormLoading'
}, res => {
this.lawsExplainQuoteRow = res.data.list
this.total = res.data.count
if (this.selectedList1.length !== 0) {
this.selectedList1.map((list) => {
this.lawsExplainQuoteRow.map((item) => {
if (list.id === item.id) {
item._checked = true
}
})
})
}
}, e => {
})
},
getTestItemRow (page = 1, pageSize = this.$store.getters.userInfo.configContent) {
this.testItemsForm.page = this.pageItems
this.testItemsForm.pageSize = this.$store.getters.userInfo.configContent
if (page === '') {
this.testItemsForm.page = 1
this.testItemsForm.testItemName = ''
}
if (this.sarStandardsInfoEO.testItems !== null && this.sarStandardsInfoEO.testItems !== '') {
this.testItemsForm.testIdList = this.sarStandardsInfoEO.testItems.toString()
}
this.$http.get('lawss/sarTestItem/page', this.testItemsForm, {
_this: this,
loading: 'testItemSearching'
}, res => {
this.testItemTableList = res.data.list
this.totalItems = res.data.count
if (this.selectedList2.length !== 0) {
this.selectedList2.map((list) => {
this.testItemTableList.map((item) => {
if (list.id === item.id) {
item._checked = true
}
})
})
}
}, e => {
})
},
// 文件上传时的钩子函数
onProgress (event, file, fileList) {
this.exportLoading = true
this.importModalshowflag = false
},
// 导入标准数据成功后执行
importFileSuccess (response, file) {
this.exportLoading = false
if (response.ok) {
this.showUploadlist = true
this.importModalshowflag = false
this.$message({
showClose: true,
message: response.message,
type: 'success'
})
// 使用字条目是否展示模态框判断导入的文件是标准,还是条目modalStandItemflag
if (this.modalStandItemflag) {
this.selectSarStandItems(this.standItemSearch.standId)
} else {
this.getDomesticStandardTable()
}
} else {
this.showUploadlist = false
this.importFailed = true
this.importForm.content = response.message
}
},
// 查看标准条目
selectSarStandItems (standid) {
this.modalStandItemflag = true
this.standItemSearch.standId = standid
this.$http.get('lawss/sarStandItems/getSarStandItemsList', this.standItemSearch, {
_this: this, loading: 'loading'
}, res => {
this.standItemList = res.data
// this.standitemTotal = res.data.count // 分页需要
}, e => {
})
},
// 点击配置标准弹出相应模态框
configurationStandard () {
// this.getMenu().then(boolean => {
// if (boolean) {
const winWidth = window.screen.width
if (winWidth > 1920) {
this.drawerWidth = 1400
} else {
this.drawerWidth = winWidth - 200
}
let menuId = this.selectSarMenu.id
if (menuId == null || menuId === '') {
this.$message({
showClose: true,
message: '请选择要配置的目录',
type: 'error'
})
} else {
if (this.selectSarMenu.parentId == null || this.selectSarMenu.parentId === '') {
this.$message({
showClose: true,
message: '请选择二级及以下目录',
type: 'error'
})
} else {
this.configStandFlag = true
this.sarConfigStandSearch.menuId = 'nomenu'
this.sarConfigStandSearch.page = 1
this.sarConfigStandSearch.country = ''
this.sarConfigStandSearch.standNumber = ''
this.sarConfigStandSearch.standName = ''
this.sarConfigStandSearch.standState = ''
this.sarConfigStandSearch.standNature = ''
this.sarConfigStandSearch.issueTime = ''
this.sarConfigStandSearch.applyArctic = ''
this.sarConfigStandSearch.replaceStandNum = ''
this.sarConfigStandSearch.replacedStandNum = ''
this.selectConfiguraStand()
}
}
// }
// })
},
// 判断当前左侧树节点是否是我的收藏和个性化标签
getMenu () {
return new Promise((resolve, reject) => {
let menu = this.selectSarMenu
if (menu.id === 'gxhbq' || menu.pId === 'gxhbq' || menu.id === 'wdsc' || menu.pId === 'wdsc') {
this.$message.warning('请选择海外标准法规及以下节点')
} else {
resolve(true)
}
})
},
// 取消配置标准
cancelConfigStand () {
this.configStandFlag = false
this.selectConfigStand = []
},
// 表对应标准移除分类到
deleteStandFromKind (flag, item) {
// this.getMenu().then(boolean => {
// if (boolean) {
if (this.selectSarMenu.parentId == null || this.selectSarMenu.parentId === '') {
this.$message({
showClose: true,
message: '请选择二级及以下目录',
type: 'error'
})
} else {
let search = {}
// 取最外层目录id
search.menuId = this.selectSarMenu.id
search.idlist = []
search.sarType = 'FOREIGN'
if (flag === 1) {
this.$confirm('确定移除该条标准?', '提示', {
confirmButtonText: '确定',
confirmButtonClass: 'common-button-primary',
cancelButtonText: '取消',
type: 'warning',
roundButton: false
}).then(() => {
search.idlist.push(item)
this.$http.putData('lawss/sarStandMenu/removeStandInfo', search, {
_this: this
}, res => {
this.getDomesticStandardTable()
}, e => {
})
}).catch(() => {
// 取消删除,清空选择
this.$refs.selection.clearSelection()
})
} else {
if (this.selectedList.length === 0) {
this.$message.error('请先选择要移除的数据!')
} else {
this.$confirm('确认移除选中数据?', '提示', {
confirmButtonText: '确定',
confirmButtonClass: 'common-button-primary',
cancelButtonText: '取消',
roundButton: false,
type: 'warning'
}).then(() => {
for (let i = 0; i < this.selectedList.length; i++) {
search.idlist.push(this.selectedList[i])
}
this.$http.putData('lawss/sarStandMenu/removeStandInfo', search, {
_this: this
}, res => {
if (res.ok) {
this.getDomesticStandardTable()
} else {
this.$message.warning(res.message)
}
}, e => {
})
}).catch(() => {
// 取消删除,清空选择
this.$refs.selection.clearSelection()
})
}
}
}
// }
// })
},
// 分页点击后方法
configuraPageChange (page) {
this.configPage = page
this.selectConfiguraStand()
},
// 分页每页显示数改变后方法
configuraPageSizeChange (pageSize) {
this.configRows = pageSize
this.selectConfiguraStand()
// 此处需要调用接口,修改个人配置
},
searchConfiguraStand () {
this.sarConfigStandSearch.page = 1
this.selectConfiguraStand()
},
selectConfigStandChange (alldata) {
this.selectConfigStand = []
for (let i = 0; i < alldata.length; i++) {
this.selectConfigStand.push(alldata[i].id)
}
},
// 提交配置搜索项
saveConfigStand () {
let search = {}
search.menuId = this.selectSarMenu.id
if (this.selectConfigStand.length === 0) {
this.$message({
showClose: true,
message: '请至少选择一条标准',
type: 'warning'
})
} else {
search.idlist = this.selectConfigStand
this.$http.postData('sarStandardsInfo/sar-standards-info/saveStandardsMenu', search, {
_this: this,
loading: 'isSubmit'
}, res => {
this.configStandFlag = false
this.$message({
showClose: true,
message: '配置标准成功!',
type: 'success'
})
this.getDomesticStandardTable()
}, e => {
})
}
},
/**
* 获取新增弹框的表单
*/
getAddFormFieldList (isEdit) {
this.$http.get('lawss/sarStandAttrDetails/list', {}, {
_this: this
},
res => {
if (res.ok) {
const { data = {} } = res
this.formFieldListData = data['FOREIGN_STAND'] || []
const formFieldListData = data['FOREIGN_STAND'] || []
// 追加高级查询动态下拉框数据s
const twoOptions = [
{
label: '标准类别',
value: 'stand_sort',
type: 'SEL_OPTION',
disabled: false
},
// {
// label: '标准性质',
// value: 'stand_nature',
// disabled: false
// },
{
label: '标准状态',
value: 'stand_state',
type: 'SEL_OPTION',
disabled: false
},
// {
// label: '适用区域',
// value: 'country',
// type: 'SEL_OPTION',
// disabled: false
// },
{
label: '重要度',
value: 'is_relate_access',
type: 'SEL_OPTION',
disabled: false
},
{
label: '标准编号',
value: 'stand_number',
type: 'INPUT',
disabled: false
},
{
label: '标准年份',
value: 'stand_year',
type: 'INPUT',
disabled: false
},
{
label: '中文名称',
value: 'stand_name',
type: 'INPUT',
disabled: false
},
{
label: '英文名称',
value: 'stand_en_name',
type: 'INPUT',
disabled: false
},
{
label: '发布日期',
value: 'issue_time',
type: 'DATE_PIC_OPTS',
disabled: false
},
{
label: '文本说明',
value: 'synopsis',
type: 'INPUT',
disabled: false
}
]
formFieldListData.forEach(item => {
if (item.attrType !== 'FILE' && item.attrField !== 'ZRLX') {
twoOptions.push({
value: item.attrField,
label: item.attrName,
selVal: item.selVal,
type: item.attrType,
disabled: false,
__wx__: item
})
}
})
this.twoOptions = twoOptions
// this.resolveFormFieldList()
}
}, e => {})
},
/**
* 展示位置
*/
queryDisplayLocation () {
return new Promise((resolve, reject) => {
this.$http.get('lawssBase/utArea/getAreaList', {
sarType: 'INLAND_STAND'
}, {
_this: this
}, res => {
resolve(res.data || [])
}, e => {
reject(e)
})
})
},
// 新增时不用
selectStandMessage () {
return new Promise((resolve, reject) => {
this.$http.get('lawss/sarStandardsInfo/getStandInfoById', {id: this.sarStandardsInfoEO.id}, {
_this: this, loading: 'loading'
}, res => {
this.sarStandardsInfoEO = res.data || []
// if (this.sarStandardsInfoEO.issueTime != null && this.sarStandardsInfoEO.issueTime !== '') {
// this.sarStandardsInfoEO.issueTime = this.sarStandardsInfoEO.issueTime.split(' ')[0]
// }
if (this.sarStandardsInfoEO.putTime != null && this.sarStandardsInfoEO.putTime !== '') {
this.sarStandardsInfoEO.putTime = this.sarStandardsInfoEO.putTime.split(' ')[0]
}
// 代替标准号
if (this.sarStandardsInfoEO.replaceStandNum !== null && this.sarStandardsInfoEO.replaceStandNum !== '') {
this.sarStandardsInfoEO.replaceStandNum = this.sarStandardsInfoEO.replaceStandNum.replace(/<br \/>/g, '\r\n')
this.sarStandardsInfoEO.replaceStandNum = this.sarStandardsInfoEO.replaceStandNum.replace(/<br \/>/g, '\n')
}
if (this.sarStandardsInfoEO.replaceStandNum != null && this.sarStandardsInfoEO.replaceStandNum !== '') {
this.replaceNumList = this.sarStandardsInfoEO.replaceStandNum.split(',')
}
Object.keys(this.sarStandardsInfoEO.attrInfoMap || {}).forEach((key) => {
if (this.sarStandardsInfoEO.attrInfoMap[key]) {
this.sarStandardsInfoEO[key] = this.sarStandardsInfoEO.attrInfoMap[key]
}
})
this.addPersonCookie()
resolve(res.data)
}, e => {
reject(e)
})
})
},
resolveFormFieldList (isEdit) {
const data = this.formFieldListData
this.formFieldList = data.map((item) => {
if (item.attrType === 'SEL_OPTION' || item.attrType === 'SEL_OPTS') {
return Object.assign({}, item, {
options: this.allSelectOptions[item.selVal]
})
} else {
return item
}
})
// 处理时间格式的数据
data.forEach(item => {
if (item.attrType === 'DATE_PICKER') {
const date = this.sarStandardsInfoEO[item.attrField] ? new Date(this.sarStandardsInfoEO[item.attrField]) : ''
this.$set(this.sarStandardsInfoEO, item.attrField, date)
} else {
this.$set(this.sarStandardsInfoEO, item.attrField, this.sarStandardsInfoEO[item.attrField] || '')
}
})
this.resolveFormFieldListRules(isEdit)
},
/**
* 生成校验规则
*/
resolveFormFieldListRules (isEdit) {
this.reloadAddForm = false
const formFieldList = this.formFieldList
const rules = {...this.defaultAddFormFieldRules}
formFieldList.forEach((item) => {
const rule = []
if (item.isMust === '0' && isEdit !== '0') {
if (item.attrType === 'DATE_PICKER') {
rule.push({required: true, type: 'date', message: `${item.attrName}不能为空`, trigger: 'blur'})
} else if (item.attrType === 'SEL_OPTION') {
rule.push({ required: true, message: `${item.attrName}不能为空`, trigger: 'change' })
} else if (item.attrType === 'DATE_PIC_OPTS') {
rule.push({ required: true, message: `${item.attrName}不能为空`, trigger: 'change' })
} else if (item.attrType === 'INPUT_NUM') {
rule.push({ required: true, message: `${item.attrName}不能为空`, trigger: 'blur' })
} else if (item.attrType === 'SEL_OPTS') {
rule.push({ required: true, message: `${item.attrName}不能为空`, trigger: 'change' })
}else if(item.attrType ==='INPUT_STR'){
rule.push({ required: true, message: `${item.attrName}不能为空`, trigger: 'change' })
}
}
// isEdit 为0 标准状态不是必填
if (isEdit === '0') {
rules.standState = [{required: false, message: '标准状态不能为空', trigger: 'change'}]
rules.issueTime = [{required: false, message: '发布日期不能为空', trigger: 'change'}]
}
if (item.attrLen && item.attrType !== 'INPUT_NUM' && item.attrType !== 'DATE_PICKER' && item.attrType !== 'SEL_OPTION' && item.attrType !== 'SEL_OPTS' && item.attrType !== 'DATE_PIC_OPTS') {
rule.push({type: 'string', max: item.attrLen, message: `${item.attrName}不能超过${item.attrLen}个字符`, trigger: 'blur'})
}
if (item.attrField === 'DTBJH' || item.attrField === 'YYBJ' || item.attrField === 'BYYBJ' || item.attrField === 'CBBH' || item.attrField === 'DXBZ') {
if (item.attrField === 'CBBH') {
rule.push({type: 'string', validator: this.verify.validateStandardItemNoRepeat, trigger: 'blur'})
} else {
rule.push({type: 'string', validator: this.verify.validateStandardItem, trigger: 'blur'})
}
}
if (rule.length > 0) {
// this.$set(this.rules, item.attrField, rule)
rules[item.attrField] = rule
}
})
// this.rules = rules
this.$set(this, 'sarStandardsInfoRules', rules)
setTimeout(() => {
this.reloadAddForm = true
}, 1000)
// this.$nextTick(() => {
// this.$refs['sarStandardsInfoForm'].resetFields()
// })
},
/**
* 是否添加进标准法规清单change事件
* 动态改变必填项
* */
isRegulationsChange (val) {
if (val === '0') {
const formFieldList = this.formFieldList
const rules = {...this.defaultAddFormFieldRules}
formFieldList.forEach((item) => {
const rule = []
if (item.isMust === '0') {
if (item.attrType === 'DATE_PICKER') {
rule.push({required: false, type: 'date', message: `${item.attrName}不能为空`, trigger: 'change'})
} else if (item.attrType === 'SEL_OPTION') {
rule.push({ required: false, message: `${item.attrName}不能为空`, trigger: 'change' })
} else if (item.attrType === 'DATE_PIC_OPTS') {
rule.push({ required: false, message: `${item.attrName}不能为空`, trigger: 'change' })
} else if (item.attrType === 'INPUT_NUM') {
rule.push({ required: false, message: `${item.attrName}不能为空`, trigger: 'change' })
} else if (item.attrType === 'SEL_OPTS') {
rule.push({ required: false, message: `${item.attrName}不能为空`, trigger: 'change' })
}
}
if (item.attrLen && item.attrType !== 'INPUT_NUM' && item.attrType !== 'DATE_PICKER' && item.attrType !== 'SEL_OPTION' && item.attrType !== 'SEL_OPTS' && item.attrType !== 'DATE_PIC_OPTS') {
rule.push({type: 'string', max: item.attrLen, message: `${item.attrName}不能超过${item.attrLen}个字符`, trigger: 'change'})
}
if (rule.length > 0) {
rules[item.attrField] = rule
}
})
// rules.standState = [{required: false, message: '标准状态不能为空', trigger: 'change'}]
rules.issueTime = [{required: false, message: '发布日期不能为空', trigger: 'change'}]
this.$set(this, 'sarStandardsInfoRules', rules)
this.$nextTick(() => {
this.$refs.sarStandardsInfoForm.clearValidate()
})
} else {
const formFieldList = this.formFieldList
const rules = {...this.defaultAddFormFieldRules}
formFieldList.forEach((item) => {
const rule = []
if (item.isMust === '0') {
if (item.attrType === 'DATE_PICKER') {
rule.push({required: true, type: 'date', message: `${item.attrName}不能为空`, trigger: 'change'})
} else if (item.attrType === 'SEL_OPTION') {
rule.push({ required: true, message: `${item.attrName}不能为空`, trigger: 'change' })
} else if (item.attrType === 'DATE_PIC_OPTS') {
rule.push({ required: true, message: `${item.attrName}不能为空`, trigger: 'change' })
} else if (item.attrType === 'INPUT_NUM') {
rule.push({ required: true, message: `${item.attrName}不能为空`, trigger: 'change' })
} else if (item.attrType === 'SEL_OPTS') {
rule.push({ required: true, message: `${item.attrName}不能为空`, trigger: 'change' })
}else if(item.attrType ==='INPUT_STR'){
rule.push({ required: true, message: `${item.attrName}不能为空`, trigger: 'change' })
}
}
if (item.attrLen && item.attrType !== 'INPUT_NUM' && item.attrType !== 'DATE_PICKER' && item.attrType !== 'SEL_OPTION' && item.attrType !== 'SEL_OPTS' && item.attrType !== 'DATE_PIC_OPTS') {
rule.push({type: 'string', max: item.attrLen, message: `${item.attrName}不能超过${item.attrLen}个字符`, trigger: 'change'})
}
if (rule.length > 0) {
rules[item.attrField] = rule
}
})
// rules.standState = [{required: true, message: '标准状态不能为空', trigger: 'change'}]
rules.issueTime = [{required: true, message: '发布日期不能为空', trigger: 'change'}]
this.$set(this, 'sarStandardsInfoRules', rules)
this.$nextTick(() => {
this.$refs.sarStandardsInfoForm.clearValidate()
})
}
},
// 获取工作组信息下拉框信息
getGzzOption () {
this.$http.get('lawss/sarGroupMenu/queryGroup', '', {
_this: this
}, res => {
if (res.ok) {
let gzzxxOptions = []
res.data.map(item => {
gzzxxOptions.push({
value: item.id,
label: item.menuName
})
})
this.allSelectOptions.GZZXX = gzzxxOptions
}
})
},
getDept () {
return new Promise((resolve, reject) => {
let url = 'sys/org/getTree'
this.$http.get(url, {}, {
_this: this
}, res => {
if (res.ok) {
let zNodesDept = []
res.data.forEach((item, i) => {
let zObj = {}
// 该节点为机构
zObj.name = item.orgName
zObj.icon = 'static/images/dept.png'
// zObj.isParent = true
zObj.shotName = item.shotName
zObj.remarks = item.remarks
zObj.id = item.id
zObj.pId = item.pId
zNodesDept[i] = zObj
})
this.orgData = zNodesDept
resolve(res.data)
}
}, e => {
reject(e)
})
})
},
formatIssueDate(str) {
const momentDate = this.$moment(str)
if (momentDate.isValid()) {
return this.$moment(str).format('YYYY-MM-DD')
} else {
return str
}
},
formatText(str) {
return formatText(str)
},
onChecked () {
this.sarStandardsInfoEO.FO = ''
this.sarStandardsInfoEO.XMPGJS = ''
},
// 编辑时文件上传成功更改标准状态
fileSuccess (boolean) {
// 判断当前是新增还是编辑
if (this.addOrUPdateFlag === 2) {
let sarStandardsInfoEO = this.sarStandardsInfoEO
let standState = sarStandardsInfoEO.standState
// 判断当前标准状态是否是:草稿、征求意见稿、送审稿、报批稿、发布稿
// switch循环已上传文件对应状态
switch (standState) {
case 'RADYSUBMIT':
if (sarStandardsInfoEO.FBGBJBD) {
sarStandardsInfoEO.standState = 'FJNVYX9Q7J'
}
break
case 'SUBMIT':
if (sarStandardsInfoEO.FBGBJBD) {
sarStandardsInfoEO.standState = 'FJNVYX9Q7J'
break
}
if (sarStandardsInfoEO.BPG) {
sarStandardsInfoEO.standState = 'RADYSUBMIT'
}
break
case 'ADVICE':
if (sarStandardsInfoEO.FBGBJBD) {
sarStandardsInfoEO.standState = 'FJNVYX9Q7J'
break
}
if (sarStandardsInfoEO.BPG) {
sarStandardsInfoEO.standState = 'RADYSUBMIT'
break
}
if (sarStandardsInfoEO.SSG) {
sarStandardsInfoEO.standState = 'SUBMIT'
}
break
case 'DRAFT':
if (sarStandardsInfoEO.FBGBJBD) {
sarStandardsInfoEO.standState = 'FJNVYX9Q7J'
break
}
if (sarStandardsInfoEO.BPG) {
sarStandardsInfoEO.standState = 'RADYSUBMIT'
break
}
if (sarStandardsInfoEO.SSG) {
sarStandardsInfoEO.standState = 'SUBMIT'
break
}
if (sarStandardsInfoEO.ZQYJG) {
sarStandardsInfoEO.standState = 'ADVICE'
}
break
}
}
}
},
computed: {
// 是否拥有拖拽权限
hasPermissionDrag () {
let has = false
let permissionList = this.$store.getters.getMenuList
permissionList.map((menu) => {
if (menu.id === '4EN5WW694V') {
has = true
}
})
return has
},
addBtnDisabled () {
if (this.selectSarMenu.id === 'wdsc' ||
this.selectSarMenu.id === 'gxhbq' ||
this.selectSarMenu.pId === 'gxhbq') {
return true
} else {
return false
}
}
},
async mounted () {
// 进入页面后查询树形结构目录
this.menuTreeLoading = true
await this.selectMenu()
this.menuTreeLoading = false
this.treeReload = true
// 从数据库中查询各下拉框数据
this.$http.get('sys/dictype/getDicTypeListCode', '', {
_this: this
}, res => {
this.allSelectOptions = res.data || {}
this.countryOptions = res.data.COUNTRY
this.regionOptions = res.data.REGION // 区域
this.standSortOptions = res.data.STANDCLASSIFY
this.applyArcticOptions = res.data.PRODUCTTYPE // 根据需求文档,产品类别对应标准属性中的“适用车型”
this.standStateOptions = res.data.STANDSTATE
this.standNatureOptions = res.data.SARPROPERTY // 标准性质
this.adoptExtentOptions = res.data.DEGREESTANDARD
this.emergyKindOptions = res.data.ENERGYTYPES
this.applyAuthOptions = res.data.PROVETYPE // 适用认证下拉框
this.categoryOptions = res.data.CATEGORY // 能源种类
this.assemClassOptions = res.data.ASSEMCLASSIFY // 总成分类
this.categoryConfigOptions = res.data.CATEGORY
this.standAttributeList = res.data.RULETYPE
this.getGzzOption()
}, e => {
})
this.getDomesticStandardTable()
// 加载所有的部门
this.getOrgTreeSource()
// 加载动态表单数据
this.getAddFormFieldList()
this.getDept()
},
destroyed () {
this.allSelectOptions = {}
this.countryOptions = []
this.regionOptions = []
this.standSortOptions = []
this.applyArcticOptions = []
this.standStateOptions = []
this.standNatureOptions = []
this.adoptExtentOptions = []
this.emergyKindOptions = []
this.applyAuthOptions = []
this.categoryOptions = []
this.assemClassOptions = []
this.categoryConfigOptions = []
this.standAttributeList = []
this.zNodesS = []
this.zNodesSItem = []
this.searchInlandNodes = []
this.orgData = []
}
}
</script>
<style lang="less" scoped>
@import '~@/assets/styles/mixins';
@import '~@/assets/styles/style';
#foreignStandardsAndRegulations{
//background: #fff;
display: flex;
height: 100%;
position: relative;
.tree-content {
background: #fff;
width: 16%;
position: relative;
.tree {
width: calc(~'100% - 15px');
position: absolute;
left: 0;
}
.tree-collapse {
position: absolute;
right: 0;
}
}
.tree-right {
overflow-y: hidden;
padding:0;
position: relative;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
.content {
display: flex;
flex-direction: column;
position: relative;
flex: auto;
.table-wrap {
flex: auto;
overflow: hidden;
display: flex;
flex-direction: column;
}
.pagination {
position: static;
/deep/ .pagination-slot {
padding: 0;
}
}
}
}
.tree-close{
.tree{
left: -200px !important;
}
.tree-right{
width: calc(~'100% - 15px') !important;
}
.side-bar-collapse{
background: #5596CC !important;
color: #FFF;
}
}
.tree-closed {
width: 15px !important;
}
.el-popover{
height: 200px;
}
.el-col-12 {
//width: 50%;
//white-space: nowrap;
}
.form-upload-btn {
width: 224px;
//line-height: 20px;
}
.el-drawer__wrapper{
.demo-drawer-content{
.drawer-content{
//height: calc(~'100% - 52px - 56px');
flex: auto;
display: flex;
flex-direction: column;
}
}
}
}
.el-textarea__inner {
line-height: 28px !important;
}
.btn-col{
padding-top: 11px;
}
</style>
<style lang="less" scoped>
#foreignStandardsAndRegulations {
height: 100%;
.tools-bar-wrapper {
align-items: start;
margin-bottom: 5px;
}
.content{
height: calc(~'100% - 53px - 56px');
background-color: #fff;
padding: 0 10px;
.table{}
}
.draw-form-item{
/deep/.el-form-item__content{
//width: 220px;
}
}
.config-stands{
/deep/.el-form-item{
margin-bottom: 0;
}
.pagination{
bottom: 50px;
}
}
.config-drawer{
margin-top: 5px;
.content{
padding: 15px 0 0 0px;
.el-table{
overflow-y: auto;
}
}
}
.advanced-class{
visibility: hidden;
}
.advanced-one{
width: 80px;
}
.advanced-two{
//
}
.advancedSearch-btn{
padding: 12px 12px;
color: #ffffff;
background: #409EFF;
border: none;
border-radius: 20px;
}
.advancedSearch-btn-reduce{
padding: 12px 12px;
color: #999;
background: #fff;
border: 1px solid #DCDFE6;
border-radius: 20px;
}
button.el-button.advancedSearch-btn-reduce.el-button--default{
margin-left: 0;
}
.advance-dialog {
.advance-dialog-form{
/deep/input.el-input__inner{
border-radius: 20px;
}
}
}
}
::v-deep .el-drawer__header{
&>span:first-child{
outline: none!important;
}
}
::v-deep .el-drawer{
outline: none!important;
}
.label-input-form {
&.table-lattice{
/deep/.el-form-item__label {
width:100px;
height:30px;
border: 1px solid #DCDFE6;
border-right: none;
line-height:30px;
text-align: center;
margin-top: 6px;
background: #F9F9F9;
}
/deep/.el-input__inner {
height: 30px;
line-height: 30px;
border-radius: 0 !important;
}
}
}
</style>