Files
foton-laws-system-front/src/pages/policyRegulation/policy/components/editDrawer.vue
T

1714 lines
70 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>
<!-- 新增编辑模态窗 -->
<el-drawer
:title="drawerTitle"
:visible.sync="modalshowflag"
:wrapperClosable="false"
size="1050px"
@close="resetForm"
>
<div class="drawer-content">
<el-form
v-if="reloadAddForm && modalshowflag"
ref="sarLawsStandEO"
:model="sarLawsStandEO"
:rules="sarLawsStandRules"
class="label-input-form"
>
<!-- 动态数据-->
<template v-for="(displayLocation, index) in dynamicFormField">
<el-col :key="index" :span="24">
<div class="divider-line">{{ displayLocation.label }}</div>
</el-col>
<template v-if="displayLocation.label === '基础信息'">
<!--#region -->
<!--<el-col :span="12">-->
<!-- <el-form-item-->
<!-- label="政策分类"-->
<!-- prop="lawsType"-->
<!-- label-width="150px"-->
<!-- class="add-form-item"-->
<!-- >-->
<!-- <template slot="label">政策分类</template>-->
<!-- <el-select v-model="sarLawsStandEO.lawsType"-->
<!-- placeholder="请选择政策分类"-->
<!-- clearable>-->
<!-- <el-option-->
<!-- v-for="opt in lawsTypeOptions"-->
<!-- :key="opt.value"-->
<!-- :value="opt.value === undefined ? '' :opt.value" :label="opt.label"-->
<!-- >-->
<!-- {{ opt.label }}-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!--</el-col>-->
<!--#endregion -->
<el-col :span="12">
<el-form-item label="1级政策分类" prop="lawsTypeFirstLevel" label-width="150px" class="add-form-item">
<template slot="label">1级政策分类</template>
<el-select
:value="initType(sarLawsStandEO.lawsTypeFirstLevel)"
placeholder="请选择1级政策分类"
multiple
clearable
@change="handleChange($event, 'lawsTypeFirstLevel')"
>
<el-option
v-for="opt in lawsTypeFirstLevelOptions"
:key="opt.value"
:value="opt.value === undefined ? '' :opt.value"
:label="opt.label"
>
{{ opt.label }}
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="2级政策分类" prop="lawsTypeSecondLevel" label-width="150px" class="add-form-item">
<template slot="label">2级政策分类</template>
<el-select
:value="initType(sarLawsStandEO.lawsTypeSecondLevel)"
placeholder="请选择2级政策分类"
multiple
clearable
@change="handleChange($event, 'lawsTypeSecondLevel')"
>
<el-option
v-for="opt in lawsTypeSecondLevelOptions"
:key="opt.value"
:value="opt.value === undefined ? '' :opt.value"
:label="opt.label"
>
{{ opt.label }}
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="3级政策分类" prop="lawsTypeThirdLevel" label-width="150px" class="add-form-item">
<template slot="label">3级政策分类</template>
<el-select
:value="initType(sarLawsStandEO.lawsTypeThirdLevel)"
placeholder="请选择3级政策分类"
multiple
clearable
@change="handleChange($event, 'lawsTypeThirdLevel')"
>
<el-option
v-for="opt in lawsTypeThirdLevelOptions"
:key="opt.value"
:value="opt.value === undefined ? '' :opt.value"
:label="opt.label"
>
{{ opt.label }}
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="4级政策分类" prop="lawsTypeFourthLevel" label-width="150px" class="add-form-item">
<template slot="label">4级政策分类</template>
<el-select
:value="initType(sarLawsStandEO.lawsTypeFourthLevel)"
placeholder="请选择4级政策分类"
multiple
clearable
@change="handleChange($event, 'lawsTypeFourthLevel')"
>
<el-option
v-for="opt in lawsTypeFourthLevelOptions"
:key="opt.value"
:value="opt.value === undefined ? '' :opt.value"
:label="opt.label"
>
{{ opt.label }}
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="政策名称" prop="lawsName" label-width="150px" class="add-form-item">
<el-input
v-model="sarLawsStandEO.lawsName"
placeholder="请输入政策名称"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="英文名称" prop="lawsEnName" label-width="150px" class="add-form-item">
<el-input
v-model="sarLawsStandEO.lawsEnName"
placeholder="请输入英文名称"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="政策文号" prop="lawsNo" label-width="150px" class="add-form-item">
<el-input
v-model="sarLawsStandEO.lawsNo"
placeholder="请输入政策文号"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="发文日期" prop="issueTime" label-width="150px" class="add-form-item">
<el-datePicker
v-model="sarLawsStandEO.issueTime"
:editable="false"
placeholder="请选择发文日期"
@change="issueTimeChange"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="发文单位" prop="issueCompany" label-width="150px" class="add-form-item">
<el-input
v-model="sarLawsStandEO.issueCompany"
placeholder="请输入发文单位"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="征集意见周期" prop="commentCycleDate2" label-width="150px" class="add-form-item">
<el-date-picker
v-model="commentCycleDate2"
:picker-options="pickerOptions"
type="daterange"
range-separator="至"
start-placeholder="起始时间"
end-placeholder="结束时间"
value-format="yyyy-MM-dd"
align="right"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="lawsTextState" label-width="150px" class="add-form-item">
<template slot="label">政策状态</template>
<el-select
v-model="sarLawsStandEO.lawsTextState"
placeholder="请选择政策状态"
clearable
>
<el-option
v-for="opt in lawsTextStateOptions"
:key="opt.value"
:value="opt.value === undefined ? '' :opt.value"
:label="opt.label"
>
{{ opt.label }}
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item prop="lawsSycx" label-width="150px" class="add-form-item">
<template slot="label">适用车型</template>
<el-select
v-model="sarLawsStandEO.lawsSycx"
multiple
placeholder="请选择适用车型"
clearable
>
<el-option
v-for="opt in lawsSycxOptions"
:key="opt.value"
:value="opt.value === undefined ? '' :opt.value"
:label="opt.label"
>
{{ opt.label }}
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否纳入认证清单" prop="isRelateAccess" label-width="150px" class="add-form-item">
<el-select v-model="sarLawsStandEO.isRelateAccess" @change="resolveFormFieldListRules">
<el-option key="1" value="1" label="是" />
<el-option key="2" value="2" label="否" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="年度" prop="lawsYear" label-width="150px" class="add-form-item">
<el-select
v-model="sarLawsStandEO.lawsYear"
value-key="id"
placeholder="请选择年度"
clearable
>
<el-option
v-for="opt in lawsYearOptions"
:key="opt.value"
:value="opt.value === undefined ? '' :opt.value"
:label="opt.label"
>
{{ opt.label }}
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="福田转发通知文号" prop="lawsNotisyncNum" label-width="150px" class="add-form-item">
<el-input
v-model="sarLawsStandEO.lawsNotisyncNum"
placeholder="请输入福田转发通知文号"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="通知文号链接" prop="notisyncNumLink" label-width="150px" class="add-form-item">
<el-input
v-model="sarLawsStandEO.notisyncNumLink"
placeholder="请输入通知文号链接"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="信息月报" prop="lawsBulletin" :rules="{ type: 'string', max: 500, message: '信息月报不能超过500个字符', trigger: 'change' }" label-width="150px" class="add-form-item">
<el-input
v-model="sarLawsStandEO.lawsBulletin"
placeholder="请输入信息月报"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="参考消息" prop="referenceNews" label-width="150px" class="add-form-item">
<el-input
v-model="sarLawsStandEO.referenceNews"
placeholder="请输入参考消息"
clearable
/>
</el-form-item>
</el-col>
<el-col :span="24" style="border-bottom: 1px dashed #e5e5e5" class="lawsKeyPoint">
<el-col :span="12">
<el-form-item prop="lawsLabel" label-width="150px" class="add-form-item" style="border-bottom: 0px solid">
<template slot="label">标签</template>
<el-select
v-model="sarLawsStandEO.lawsLabel"
multiple
placeholder="请选择标签"
clearable
>
<el-option
v-for="opt in lawsLabelOptions"
:key="opt.value"
:value="opt.value === undefined ? '' :opt.value"
:label="opt.label"
>
{{ opt.label }}
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<CustomTextarea
v-model="sarLawsStandEO.lawsKeyPoint"
:config="{
attrName: '政策要点',
attrField: 'lawsKeyPoint'
}"
/>
</el-col>
</el-col>
<el-col :span="24">
<CustomTextarea
v-model="sarLawsStandEO.lawsRemark"
:config="{
attrName: '备注',
attrField: 'lawsRemark'
}"
/>
</el-col>
<el-col :span="24">
<el-form-item
label="政策原文链接"
prop="lawsOriginalLink"
label-width="150px"
class="add-form-item"
title="政策原文链接"
>
<el-input
v-model="sarLawsStandEO.lawsOriginalLink"
placeholder="政策原文链接"
clearable
/>
</el-form-item>
</el-col>
<!--#region-->
<!--<el-col :span="12">-->
<!-- <el-form-item label="政策编号" prop="lawsNumber" label-width="150px" class="add-form-item">-->
<!-- <el-input-->
<!-- v-model="sarLawsStandEO.lawsNumber"-->
<!-- :maxlength="100"-->
<!-- placeholder="请输入政策编号"-->
<!-- clearable-->
<!-- ></el-input>-->
<!-- </el-form-item>-->
<!--</el-col>-->
<!--<el-col :span="12">-->
<!-- <el-form-item prop="lawsSyqy" label-width="150px" class="add-form-item">-->
<!-- <template slot="label">适用区域</template>-->
<!-- <el-select v-model="sarLawsStandEO.lawsSyqy" multiple-->
<!-- placeholder="请选择适用区域"-->
<!-- clearable>-->
<!-- <el-option-->
<!-- v-for="opt in lawsSyqyOptions"-->
<!-- :key="opt.value"-->
<!-- :value="opt.value === undefined ? '' :opt.value" :label="opt.label"-->
<!-- >-->
<!-- {{ opt.label }}-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<!--</el-col>-->
<!--#endregion -->
</template>
<template v-for="field in displayLocation.child">
<el-col :span="12">
<template v-if="field.attrField === 'SVPPS'">
<custom-SVPPS
:key="field.attrField"
v-model="sarLawsStandEO[field.attrField]"
:config="field"
:disabled="formdisableflag"
/>
</template>
<!--人员选择:投稿人||责任工程师-->
<template v-else-if="field.attrField === 'TGRLAWS' || field.attrField === 'ZRGCSLAWS'">
<el-form-item
v-if="field.attrField === 'TGRLAWS'"
prop="TGRBUSS"
label-width="150px"
class="add-form-item"
>
<template slot="label">投稿人</template>
<el-input
v-model="sarLawsStandEO['TGRLAWS']"
clearable
placeholder="选择投稿人"
readonly
@click.native="choice('role', '选择投稿人', sarLawsStandEO['TGRLAWS'])"
/>
</el-form-item>
<el-form-item
v-if="field.attrField === 'ZRGCSLAWS'"
prop="ZRGCSLAWS"
label-width="150px"
class="add-form-item"
>
<template slot="label">责任工程师</template>
<el-input
v-model="sarLawsStandEO['ZRGCSLAWS']"
clearable
placeholder="选择责任工程师"
readonly
@click.native="choice('role', '选择责任工程师', sarLawsStandEO['ZRGCSLAWS'])"
/>
</el-form-item>
</template>
<!--部门选择树:投稿单位|责任部门-->
<template v-else-if="field.attrField === 'ZRBMLAWS' || field.attrField === 'TGDWLAWS'">
<el-form-item
v-if="field.attrField === 'TGDWLAWS'"
prop="ZRBMLAWS"
label-width="150px"
class="add-form-item"
>
<template slot="label">投稿单位</template>
<el-input
v-model="sarLawsStandEO['TGDWLAWS']"
:config="zrbmOptions"
clearable
placeholder="选择投稿单位"
readonly
@click.native="choiceZRBM('dep', '选择投稿单位', sarLawsStandEO.TGDWLAWSID)"
/>
</el-form-item>
<el-form-item
v-if="field.attrField === 'ZRBMLAWS'"
prop="ZRBMLAWS"
label-width="150px"
class="add-form-item"
>
<template slot="label">责任部门</template>
<el-input
v-model="sarLawsStandEO['ZRBMLAWS']"
:config="zrbmOptions"
clearable
placeholder="选择责任部门"
readonly
@click.native="choiceZRBM('dep', '选择责任部门', sarLawsStandEO.ZRBMLAWSID)"
/>
</el-form-item>
</template>
<!--输入框(字符串)-->
<template v-else-if="field.attrType === 'INPUT_STR' && field.attrField !== 'XGJLBUSS' && field.attrField !== 'XGJH'">
<template v-if="field.attrField === 'GFXYYWJ'">
<custom-input-for-standards
:key="field.attrField"
v-model="sarLawsStandEO[field.attrField]"
:config="field"
:disabled="formdisableflag"
/>
</template>
<template v-else-if="field.attrField === 'FSRQBUSS'">
<custom-input
:key="field.attrField"
v-model="sarLawsStandEO[field.attrField]"
:config="field"
disabled
/>
</template>
<template v-else-if="field.attrField === 'TXLBBUSS'">
<el-form-item
prop="TXLBBUSS"
label-width="150px"
class="add-form-item"
>
<template slot="label">体系类别</template>
<el-input v-model="sarLawsStandEO.TXLBBUSS" placeholder="选择体系类别" @click.native="choiceZRR1('TXLBBUSS', '体系类别', sarLawsStandEO.TXLBBUSS)" />
</el-form-item>
</template>
<template v-else-if="field.attrField === 'VPPSBMBUSS'">
<el-form-item
prop="VPPSBMBUSS"
label-width="150px"
class="add-form-item"
>
<template slot="label">关联模块--VPPS编码</template>
<el-input v-model="sarLawsStandEO.VPPSBMBUSS" placeholder="选择VPPS编码" @click.native="choiceZRR2('VPPSBMBUSS', 'VPPS编码', sarLawsStandEO.VPPSBMBUSS,true)" />
</el-form-item>
</template>
<template v-else-if="field.attrField === 'VPPSCNBUSS'">
<el-form-item
title="关联模块--中文名称"
label="关联模块--中文名称"
label-width="150px"
prop="VPPSCNBUSS"
class="add-form-item"
>
<el-input
v-model="sarLawsStandEO.VPPSCNBUSS"
disabled
clearable
/>
</el-form-item>
</template>
<template v-else-if="field.attrField === 'DTWJHLAWS' || field.attrField === 'YYBZZCLAWS' || field.attrField === 'BDTWJHLAWS'">
<custom-input-for-standards
:key="field.attrField"
v-model="sarLawsStandEO[field.attrField]"
:config="field"
:class="field.attrField === 'BYYBJ' ? 'classDisplay' : ''"
:disabled="formdisableflag"
@popoverHide="popoverHideQuery"
/>
</template>
<!--相关流程/参会记录-->
<template v-else-if="field.attrField === 'XGLC' || field.attrField === 'CHJLLAWS'">
<custom-input
:key="field.attrField"
v-model="sarLawsStandEO[field.attrField]"
:config="field"
disabled
/>
</template>
<template v-else-if="field.attrField === 'XCSJBUSS'">
<custom-input
:key="field.attrField"
v-model="sarLawsStandEO[field.attrField]"
:config="field"
disabled
/>
</template>
<template v-else>
<custom-input
:key="field.attrField"
v-model="sarLawsStandEO[field.attrField]"
:config="field"
:disabled="formdisableflag"
/>
</template>
</template>
<!--实施日期-多个日期标签-->
<template v-else-if="field.attrField === 'SSRQLAWS'">
<DatePickerGroupFormItem
:key="field.attrField"
v-model="sarLawsStandEO[field.attrField]"
:label="field.attrName"
:prop="field.attrField"
label-width="150px"
:disabled="formdisableflag"
/>
</template>
<!--单日期选择-->
<template v-else-if="field.attrType === 'DATE_PICKER'">
<custom-date-pick
:key="field.attrField"
v-model="sarLawsStandEO[field.attrField]"
:config="field"
:disabled="formdisableflag"
/>
</template>
<!--文件-->
<template v-else-if="field.attrType === 'FILE'">
<custom-file
:key="field.attrField"
v-model="sarLawsStandEO[field.attrField]"
:config="field"
:disabled="formdisableflag"
/>
</template>
<!--文本框-->
<template v-else-if="field.attrType === 'TEXTAREA'">
<custom-textarea
:key="field.attrField"
v-model="sarLawsStandEO[field.attrField]"
:config="field"
:disabled="formdisableflag"
/>
</template>
<template v-else-if="field.selVal === 'ORGLIST' || field.selVal === 'USERLIST' || field.selVal === 'ROLELIST'">
<template v-if="field.attrField === 'ZQCBM' || field.attrField === 'ZRBM'">
<el-form-item :label="field.attrName" :prop="field.attrField" label-width="150px" class="add-form-item form-item-disabled">
<input
v-model="sarLawsStandEO[field.attrField]"
type="hidden"
></input>
<el-input
v-model="field.valueName"
disabled
placeholder="选择对应起草人后自动带出"
/>
</el-form-item>
</template>
<template v-else>
<custom-org
v-if="field.attrField !== 'WFSPJS'"
:key="field.attrField"
v-model="sarLawsStandEO[field.attrField]"
:config="field"
:zNodes="orgData"
:disabled="formdisableflag"
:data-model="sarLawsStandEO"
@on-dept="(pOrgId, pOrgName) => onDept(pOrgId, pOrgName, field)"
/>
</template>
</template>
<!--单选下拉框-->
<template v-else-if="field.attrType === 'SEL_OPTION'">
<custom-select
:key="field.attrField"
v-model="sarLawsStandEO[field.attrField]"
:config="field"
:disabled="formdisableflag"
/>
</template>
<!--多选下拉框-->
<template v-else-if="field.attrType === 'SEL_OPTS'">
<custom-select-array
:key="field.attrField"
v-model="sarLawsStandEO[field.attrField]"
:config="field"
:disabled="formdisableflag || field.attrField === 'YQLX'"
/>
</template>
</el-col>
</template>
</template>
</el-form>
</div>
<div class="drawer-footer">
<el-button icon="el-icon-check" type="primary" :loading="isSubmit" @click="saveOrUpdateStands">提交</el-button>
<el-button icon="el-icon-close" :loading="isSubmit" @click="resetForm">取消</el-button>
</div>
</el-drawer>
<Role-tree
:is-title="choiceTitle"
:is-visible.sync="modalShowRoleFlag"
:nodeList="nodeList"
@checkedRole="checkedRole"
/>
<Mechanism-tree
:is-title="choiceTitle"
:is-visible.sync="modalShowDepFlag"
:nodeList="nodeListDep"
@checkedRole="drawerCheckDep"
/>
</div>
</template>
<script>
import CustomSVPPS from '@/components/CustomFormComponents/SVPPS'
import CustomInputForStandards from '@/components/CustomFormComponents/InputForStandardsForLaws'
import CustomInput from '@/components/CustomFormComponents/Input'
// import CusTomDataPickerGroup
// from "@/pages/regulatoryRepository/localProductsOrProjectLibrary/components/DatePickerGroup";
import DatePickerGroupFormItem from '@/components/hzwlComponents/DatePickerGroupFormItem';
import CustomDatePick from '@/components/CustomFormComponents/DatePicker'
import CustomFile from '@/components/CustomFormComponents/File'
import CustomTextarea from '@/components/CustomFormComponents/Textarea'
import CustomOrg from '@/components/CustomFormComponents/OrgTree'
import CustomSelect from '@/components/CustomFormComponents/Select'
import customSelectArray from '@/components/CustomFormComponents/SelectArray'
import RoleTree from '@/components/roleTree';
import MechanismTree from '@/components/mechanismTree';
import moment from 'moment';
export default {
name: 'EditDrawer',
components: {
CustomSVPPS,
CustomInputForStandards,
CustomInput,
// CusTomDataPickerGroup,
DatePickerGroupFormItem,
CustomDatePick,
CustomFile,
CustomTextarea,
CustomOrg,
CustomSelect,
customSelectArray,
RoleTree,
MechanismTree
},
props: {
formFieldListData: {
type: Array,
required: true
},
getBussionStandTable: {
type: Function,
required: true
},
selectSarMenu: {
type: Object,
required: true
}
},
data () {
return {
drawerTitle: '',
modalshowflag: false,
reloadAddForm: false,
sarLawsStandEO: {
// 基础信息
lawsType: '',
lawsNumber: '',
lawsName: '',
lawsEnName: '',
lawsNo: '',
issueTime: '',
issueCompany: '',
commentCycleStart: '',
commentCycleEnd: '',
lawsTextState: '',
lawsSyqy: '',
lawsSycx: '',
isRelateAccess: '',
lawsYear: '',
lawsNotisyncNum: '',
lawsBulletin: '',
lawsLabel: '',
referenceNews: '',
lawsRemark: '',
lawsKeyPoint: '',
lawsOriginalLink: '',
// 实施日期
SSRQLAWS: '',
XCXSSRQLAWS: '',
ZCXSSRQLAWS: '',
// 文本信息
ZCWBLAWS: '',
GCWBLAWS: '',
JDWJLAWS: '',
FBGBUSS: '',
BZSMBUSS: '',
LSBBBUSS: '',
QTWJBUSS: '',
// 适用范围
FBJGLAWS: '',
CYSDLAWS: '',
TGRLAWS: '',
TGDWLAWS: '',
NYLXLAWS: '',
YYRZLAWS: '',
ZRBMLAWS: '',
ZRGCSLAWS: '',
// 关联信息
DTQBBHBUSS: '',
BDTQBBHBUSS: '',
XGJLBUSS: '',
XGLC: '',
GLWJBUSS: '',
XCSJBUSS: '',
TXLBBUSS: '',
VPPSBMBUSS: '',
VPPSCNBUSS: '',
regionShow: '亚洲',
region: '2T8PFTSYE7',
issueUnit: '', // 发布部门
assemClass: '',
id: '',
standType: 'INLAND', // 标准分类
textStatusBuss: '',
country: 'CN',
standSort: '',
applyArctic: '',
standNumber: '',
standYear: '',
standName: '',
standEnName: '',
standStatus: '',
standCode: '',
standNature: '',
replaceStandNum: '',
replaceStandNumId: '',
// replaceStandNumCope: '',
replaceStandNumList: [],
replacedStandNum: '',
interStandNum: '',
adoptExtent: '',
emergyKind: '',
applyAuth: '',
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: []
}, // 标准新增过程中用到的对象
sarLawsStandRules: {},
moreSarLawsStandRules: {
lawsTypeFirstLevel: [
{ required: true, message: '1级政策分类不能为空', trigger: 'change' }
],
lawsTypeSecondLevel: [
{ required: true, message: '2级政策分类不能为空', trigger: 'change' }
],
lawsTypeThirdLevel: [
{ required: true, message: '3级政策分类不能为空', trigger: 'change' }
],
lawsTypeFourthLevel: [
{ required: true, message: '4级政策分类不能为空', trigger: 'change' }
],
lawsName: [
{ required: true, message: '政策名称不能为空', trigger: 'change' },
{ type: 'string', max: 500, message: '政策名称不能超过500个字符', trigger: 'change' },
{ validator: this.verify.checkSpecialCharacterOftags, trigger: 'change' }
],
lawsEnName: [
{ type: 'string', max: 500, message: '英文名称不能超过500个字符', trigger: 'change' },
{ validator: this.verify.valiateEnName, trigger: 'change' }
],
lawsNo: [
{ type: 'string', max: 100, message: '政策文号不能超过100个字符', trigger: 'change' }
],
issueTime: [
{ required: true, message: '发文日期不能为空', trigger: 'change' },
],
issueCompany: [
{ required: true, type: 'string', message: '发文单位不能为空', trigger: 'change' },
{ type: 'string', max: 100, message: '发文单位不能超过100个字符', trigger: 'change' }
],
lawsTextState: [
{ required: true, message: '标准状态不能为空', trigger: 'change' }
],
isRelateAccess: [
{ required: true, message: '是否纳入认证清单不能为空', trigger: 'change' }
],
lawsYear: [
{ required: true, message: '年度不能为空', trigger: 'change' }
],
lawsNotisyncNum: [
{ type: 'string', max: 500, message: '福田转发通知文号不能超过500个字符', trigger: 'change' }
],
lawsRemark: [
{ type: 'string', max: 500, message: '备注不能超过500个字符', trigger: 'change' }
],
referenceNews: [
{ type: 'string', max: 500, message: '参考消息不能超过500个字符', trigger: 'change' }
],
lawsKeyPoint: [
{ type: 'string', max: 1000, message: '政策要点不能超过1000个字符', trigger: 'change' }
],
lawsOriginalLink: [
{ type: 'string', max: 500, message: '政策原文链接不能超过500个字符', trigger: 'change' }
],
},
littleSarLawsStandRules: {
lawsTypeFirstLevel: [
{ required: true, message: '1级政策分类不能为空', trigger: 'change' }
],
lawsTypeSecondLevel: [
{ required: true, message: '2级政策分类不能为空', trigger: 'change' }
],
lawsTypeThirdLevel: [
{ required: true, message: '3级政策分类不能为空', trigger: 'change' }
],
lawsTypeFourthLevel: [
{ required: true, message: '4级政策分类不能为空', trigger: 'change' }
],
lawsName: [
{ required: true, message: '政策名称不能为空', trigger: 'change' },
{ type: 'string', max: 500, message: '政策名称不能超过500个字符', trigger: 'change' },
{ validator: this.verify.checkSpecialCharacterOftags, trigger: 'change' }
],
lawsEnName: [
{ type: 'string', max: 500, message: '英文名称不能超过500个字符', trigger: 'change' },
{ validator: this.verify.valiateEnName, trigger: 'change' }
],
lawsNo: [
{ type: 'string', max: 100, message: '政策文号不能超过100个字符', trigger: 'change' }
],
issueCompany: [
{ type: 'string', max: 100, message: '发文单位不能超过100个字符', trigger: 'change' }
],
lawsNotisyncNum: [
{ type: 'string', max: 500, message: '福田转发通知文号不能超过500个字符', trigger: 'change' }
],
lawsRemark: [
{ type: 'string', max: 500, message: '备注不能超过500个字符', trigger: 'change' }
],
referenceNews: [
{ type: 'string', max: 500, message: '参考消息不能超过500个字符', trigger: 'change' }
],
lawsKeyPoint: [
{ type: 'string', max: 1000, message: '政策要点不能超过1000个字符', trigger: 'change' }
],
lawsOriginalLink: [
{ type: 'string', max: 500, message: '政策原文链接不能超过500个字符', trigger: 'change' }
],
}, // 认证清单为否 的校验
commentCycleDate2: [],
pickerOptions: {
shortcuts: [ {
text: '最近一周',
onClick (picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
picker.$emit('pick', [ start, end ]);
}
}, {
text: '最近一个月',
onClick (picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
picker.$emit('pick', [ start, end ]);
}
}, {
text: '最近三个月',
onClick (picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
picker.$emit('pick', [ start, end ]);
}
} ]
},
formdisableflag: false,
orgData: [],
isSubmit: false,
sarType: 'FOREIGN_LAWS',
dynamicFormField: [],
choiceTitle: '', // 人员选择
modalShowRoleFlag: false,
nodeList: [],
zrbmOptions: {
attrName: '责任部门',
options: []
}, // 责任部门下拉框
modalShowDepFlag: false, // 部门选择
nodeListDep: []
}
},
created () {
this.getDicTypeListCode()
// this.getDept()
},
methods: {
issueTimeChange (val) {
const year = moment(val).format('YYYY')
this.sarLawsStandEO.lawsYear = this.lawsYearOptions.find(item => item.label === year)?.value || ''
},
initType (value) {
if (value && value !== '') {
return value.split(',')
} else {
return []
}
},
handleChange (event, type) {
this.sarLawsStandEO[type] = event.join(',')
},
// 编辑
selectStandardPro (row, state) {
this.$http.get('lawss/sarLawsInfo/getStandInfoUpdateById', { id: row.id }, {
_this: this
}, res => {
if(res.data) {
const item = res.data || {}
this.sarLawsStandEO = JSON.parse(JSON.stringify(item))
Object.keys(item.attrInfoMap || {}).forEach((key) => {
if (item.attrInfoMap[key]) {
this.$set(this.sarLawsStandEO, key, item.attrInfoMap[key])
}
})
// 适用区域
// this.sarLawsStandEO['lawsSyqy'] = this.filterObj(this.sarLawsStandEO['lawsSyqy'])
// 适用车型
this.sarLawsStandEO['lawsSycx'] = this.filterObj(this.sarLawsStandEO['lawsSycx'])
// 标签
this.sarLawsStandEO['lawsLabel'] = this.filterObj(this.sarLawsStandEO['lawsLabel'])
// this.sarLawsStandEO['YYRZLAWS'] = this.filterObj(this.sarLawsStandEO['YYRZLAWS'])
// this.sarLawsStandEO['NYLXLAWS'] = this.filterObj(this.sarLawsStandEO['NYLXLAWS'])
// 投稿人
// this.sarLawsStandEO['TGRLAWS'] = this.filterObj(this.sarLawsStandEO['TGRLAWS'])
// 投稿单位
this.sarLawsStandEO['TGDWLAWS'] = this.filterObj(this.sarLawsStandEO['TGDWLAWS'])
this.sarLawsStandEO['TGDWLAWSID'] = this.filterObj(this.sarLawsStandEO['TGDWLAWSID'])
// 责任部门
this.sarLawsStandEO['ZRBMLAWS'] = this.filterObj(this.sarLawsStandEO['ZRBMLAWS'])
this.sarLawsStandEO['ZRBMLAWSID'] = this.filterObj(this.sarLawsStandEO['ZRBMLAWSID'])
const dateArr = []
if(this.sarLawsStandEO.commentCycleStart && this.sarLawsStandEO.commentCycleEnd) {
dateArr[0] = this.sarLawsStandEO.commentCycleStart
dateArr[1] = this.sarLawsStandEO.commentCycleEnd
this.commentCycleDate2 = dateArr
}
this.sarLawsStandEO['XCSJBUSS'] = this.dateFormatter()
// let subClass = item.standSubclass
// this.sarLawsStandEO.standSubclass = subClass
if (this.sarLawsStandEO.issueTime != null && this.sarLawsStandEO.issueTime !== '') {
this.sarLawsStandEO.issueTime = new Date(this.sarLawsStandEO.issueTime)
}
if (this.sarLawsStandEO.putTime != null && this.sarLawsStandEO.putTime !== '') {
this.sarLawsStandEO.putTime = new Date(this.sarLawsStandEO.putTime)
}
this.sarLawsStandEO['id'] = item.id
this.drawerTitle = '修改政策标准'
this.modalshowflag = true
try {
this.resolveFormFieldList(true)
this.$nextTick(() => {
Promise.all([ this.queryDisplayLocation() ]).then((values) => {
const [ displayLocation ] = values
const dynamicFormField = this.sarLawsStandEO
const formFieldList = this.formFieldList
formFieldList.forEach((field) => {
displayLocation.forEach((location) => {
let value = dynamicFormField[field.attrField]
let valueName = ''
if (value && typeof value === 'number') {
value = this.$dateFormat(value, 'yyyy-MM-dd')
}
field['value'] = value
// 追加用户名称和部门名称
if (field.selVal === 'ORGLIST' || field.selVal === 'USERLIST' || field.attrField === 'SVPPS') {
const 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
console.log('this.dynamicFormField', this.dynamicFormField)
this.loading = false
})
if (state === 'show') {
this.formdisableflag = true
} else {
// this.standGeneraSelectChange() // 负责细类初始化
// this.getOrgTreeSource()
this.addOrUPdateFlag = 2
this.formdisableflag = false
this.saveOldNum = item.standCode // 记录修改之前的标准编号
this.saveOldReplaceNum = item.replaceStandNum // 记录修改之前的代替标准编号
// let selectNode = this.getTreeNameByid(this.sarLawsStandEO.responsibleUnit)
this.sarLawsStandEO.orgName = item.responsibleUnitShow
}
})
} catch (e) {
console.log(e)
}
}
})
},
queryDisplayLocation () {
return new Promise((resolve, reject) => {
this.$http.get('lawssBase/utArea/getAreaList', {
sarType: this.sarType
}, {
_this: this
}, res => {
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') {
if(item.attrField === 'WSSMR') {
return Object.assign({}, item, {
options: this.allSelectOptions['WSSMR']
})
}else if(item.attrField === 'QCDW') {
return Object.assign({}, item, {
options: this.allSelectOptions['QCDW']
})
}else if(item.attrField === 'CYSD') {
return Object.assign({}, item, {
options: this.allSelectOptions['WSCYSD']
})
}else if(item.attrField === 'SYCXCLASS') {
return Object.assign({}, item, {
options: this.allSelectOptions['ENERGYTYPES']
})
}else if(item.attrField === 'NYLX') {
return Object.assign({}, item, {
options: this.allSelectOptions['NYLXCLASS']
})
}else if(item.attrField === 'SYCPX') {
return Object.assign({}, item, {
options: this.allSelectOptions['SYCPXCLASS']
})
}else if(item.attrField === 'SYRZ') {
return Object.assign({}, item, {
options: this.allSelectOptions['SYRZCLASS']
})
}else if(item.attrField === 'ZRBM') {
return Object.assign({}, item, {
options: this.allSelectOptions['ZRBMCLASS']
})
}else if(item.attrField === 'ZRGCS') {
return Object.assign({}, item, {
options: this.allSelectOptions['ZRGCSCLASS']
})
}else if(item.attrField === 'TXLB') {
return Object.assign({}, item, {
options: this.allSelectOptions['TXLBCLASS']
})
}else {
return Object.assign({}, item, {
options: this.allSelectOptions[item.selVal]
})
}
} else {
return item
}
})
// 处理时间格式的数据 -> 多此一举
// data.forEach(item => {
// if (item.attrType === 'DATE_PICKER') {
// console.log(this.sarLawsStandEO[item.attrField])
// const date = this.sarLawsStandEO[item.attrField] ? new Date(this.sarLawsStandEO[item.attrField]) : ''
// this.$set(this.sarLawsStandEO, item.attrField, date)
// } else {
// this.$set(this.sarLawsStandEO, item.attrField, this.sarLawsStandEO[item.attrField] || '')
// }
// })
this.resolveFormFieldListRules()
},
resolveFormFieldListRules () {
this.reloadAddForm = false
let rules = {}
// 根据 是否纳入认证清单 字段 设置校验规则
if (this.sarLawsStandEO.isRelateAccess === '2') {
rules = this.littleSarLawsStandRules
} else {
rules = { ...this.moreSarLawsStandRules }
}
this.$set(this, 'sarLawsStandRules', rules)
this.$nextTick(() => {
this.reloadAddForm = true
})
},
resetForm () {
this.modalshowflag = false
this.$refs['sarLawsStandEO'].resetFields()
// $('.ivu-drawer-body').scrollTop(0)
},
// 保存或修改标准
saveOrUpdateStands () {
this.$refs['sarLawsStandEO'].validate((valid) => {
if (valid) {
// 验证标准号是否唯一
this.validateStandNumber(this.sarLawsStandEO).then((flag) => {
if (flag) {
// 时间格式修改
const nowstandinfo = JSON.parse(JSON.stringify(this.sarLawsStandEO))
if (nowstandinfo.issueTime != null && nowstandinfo.issueTime !== '') {
nowstandinfo.issueTime = this.$dateFormat(this.sarLawsStandEO.issueTime, 'yyyy-MM-dd hh:mm:ss')
}
if (nowstandinfo.putTime != null && nowstandinfo.putTime !== '') {
nowstandinfo.putTime = this.$dateFormat(this.sarLawsStandEO.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.$moment(this.sarLawsStandEO[item.attrField]).format('YYYY-MM-DD')
// 还需处理多个日期
nowstandinfo[item.attrField] = this.sarLawsStandEO[item.attrField].split(',').map(attr => this.$moment(attr).format('YYYY-MM-DD')).join(',')
} else if (item.attrType === 'DATE_PICKER' && !value) {
delete nowstandinfo[item.attrField]
}
// 数组处理
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, '\'')
// 新增
if (this.addOrUPdateFlag === 1) {
if (this.selectSarMenu.pId != null && this.selectSarMenu.pId !== '') {
nowstandinfo.menuId = this.selectSarMenu.id // 新建过程中标准所属目录是当前目录
} else {
nowstandinfo.menuId = '897c1e6fbbd2427591f0'
}
// 预警信息判断
if (nowstandinfo.replaceStandNum != null && nowstandinfo.standNumber !== '') {
nowstandinfo.upReplaceNumFlag = 1
}
if (nowstandinfo.firstPutTime != null && nowstandinfo.firstPutTime !== '') {
nowstandinfo.firstPutTime = nowstandinfo.firstPutTime.toString()
}
if (nowstandinfo['lawsSyqy'] != null && (nowstandinfo['lawsSyqy'] instanceof Array)) {
nowstandinfo['lawsSyqy'] = nowstandinfo['lawsSyqy'].join(',')
}else {
nowstandinfo['lawsSyqy'] = '';
}
if (nowstandinfo['lawsSycx'] != null && (nowstandinfo['lawsSycx'] instanceof Array)) {
nowstandinfo['lawsSycx'] = nowstandinfo['lawsSycx'].join(',')
}else {
nowstandinfo['lawsSycx'] = '';
}
if (nowstandinfo['lawsLabel'] != null && (nowstandinfo['lawsLabel'] instanceof Array)) {
nowstandinfo['lawsLabel'] = nowstandinfo['lawsLabel'].join(',')
}else {
nowstandinfo['lawsLabel'] = '';
}
if(this.commentCycleDate2 && this.commentCycleDate2.length > 0) {
nowstandinfo.commentCycleStart = this.commentCycleDate2[0]
nowstandinfo.commentCycleEnd = this.commentCycleDate2[1]
}else if (this.commentCycleDate2 === null) {
nowstandinfo.commentCycleStart = null
nowstandinfo.commentCycleEnd = null
}
this.$http.postData('lawss/sarLawsInfo/updateSarLawsStandInfo', nowstandinfo, {
_this: this,
loading: 'isSubmit'
}, res => {
if (res.ok) {
this.getBussionStandTable()
this.resetForm()
}
}, e => {
})
} else {
// 修改
// 预警信息判断
if (nowstandinfo.replaceStandNum !== this.saveOldReplaceNum) {
nowstandinfo.upReplaceNumFlag = 1
}
if (nowstandinfo.standCode !== this.saveOldNum) {
nowstandinfo.upNumFlag = 1
}
if (nowstandinfo.firstPutTime != null && nowstandinfo.firstPutTime !== '') {
nowstandinfo.firstPutTime = this.$dateFormat(this.sarLawsStandEO.firstPutTime, 'yyyy-MM-dd hh:mm:ss')
}
if (nowstandinfo['lawsSyqy'] != null && (nowstandinfo['lawsSyqy'] instanceof Array)) {
nowstandinfo['lawsSyqy'] = nowstandinfo['lawsSyqy'].join(',')
}else {
nowstandinfo['lawsSyqy'] = '';
}
if (nowstandinfo['lawsSycx'] != null && (nowstandinfo['lawsSycx'] instanceof Array)) {
nowstandinfo['lawsSycx'] = nowstandinfo['lawsSycx'].join(',')
}else {
nowstandinfo['lawsSycx'] = '';
}
if (nowstandinfo['lawsLabel'] != null && (nowstandinfo['lawsLabel'] instanceof Array)) {
nowstandinfo['lawsLabel'] = nowstandinfo['lawsLabel'].join(',')
}else {
nowstandinfo['lawsLabel'] = '';
}
if(this.commentCycleDate2 && this.commentCycleDate2.length > 0) {
nowstandinfo.commentCycleStart = this.commentCycleDate2[0]
nowstandinfo.commentCycleEnd = this.commentCycleDate2[1]
}else if (this.commentCycleDate2 === null) {
nowstandinfo.commentCycleStart = null
nowstandinfo.commentCycleEnd = null
}
this.$http.postData('lawss/sarLawsInfo/updateSarLawsStandInfo', nowstandinfo, {
_this: this,
loading: 'isSubmit'
}, res => {
if (res.ok) {
this.getBussionStandTable()
// this.pageChange(1)
this.resetForm()
}
}, e => {
})
}
} else {
this.isSubmit = false
}
})
} else {
this.$message.error('请检查表单是否填写正确!')
}
})
},
// #region
// 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.map((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)
// })
// })
// },
// 人员选择事件
// onDept (pOrgId, pOrgName, field) {
// let deptTitleName = field.attrField === 'ZYQCR' ? 'ZQCBM' : 'ZRBM'
// let dynamicFormFieldIndex = null
// let zrbmIndex = null
// let zqcbmIndex = null
// // 判断赋值部门字段
// if (field.attrField === 'ZYQCR' || field.attrField === 'QTQCR') {
// this.dynamicFormField.map((item, indexs) => {
// if (item.value === '2YVQYFS332W5XWAAY25F') {
// dynamicFormFieldIndex = indexs
// item.child.map((items, index) => {
// if (items.attrField === deptTitleName) {
// items.valueName = pOrgName
// items.value = pOrgId
// // 存贮起草部门原始信息
// if (deptTitleName === 'ZRBM') {
// this.qcbm = pOrgId
// this.qcbmName = pOrgName
// }
// }
// switch (items.attrField) {
// case 'ZQCBM':
// zqcbmIndex = index
// this.sarLawsStandEO.ZQCBM = items.value
// break
// case 'ZRBM':
// zrbmIndex = index
// break
// }
// })
// }
// })
// // 拼接起草部门信息(起草部门 + 主起草部门)
// let zqcbmId = this.dynamicFormField[dynamicFormFieldIndex].child[zqcbmIndex].value ? this.dynamicFormField[dynamicFormFieldIndex].child[zqcbmIndex].value : ''
// let zqcbmName = this.dynamicFormField[dynamicFormFieldIndex].child[zqcbmIndex].valueName ? this.dynamicFormField[dynamicFormFieldIndex].child[zqcbmIndex].valueName : ''
// let orgIdList = (this.qcbm !== '' ? this.qcbm + ',' + zqcbmId : zqcbmId).split(',')
// let orgNameList = (this.qcbmName !== '' ? this.qcbmName + ',' + zqcbmName : zqcbmName).split(',')
// this.dynamicFormField[dynamicFormFieldIndex].child[zrbmIndex].valueName = [...new Set(orgNameList)].join(',')
// this.dynamicFormField[dynamicFormFieldIndex].child[zrbmIndex].value = [...new Set(orgIdList)].join(',')
// // this.sarLawsStandEO.ZRBM = [...new Set(orgIdList)].join(',')
// this.$set(this.sarLawsStandEO, 'ZRBM', [...new Set(orgIdList)].join(','))
// }
// },
// #endregion
popoverHideQuery (ids, attrField) {
console.log(ids)
console.log('-----------------------------')
console.log(attrField)
},
// 字符串转数组
filterObj (obj) {
if(obj && obj !== '') {
if(obj instanceof Array) {
return obj;
}else {
return obj.split(',')
}
}
return '';
},
dateFormatter () {
// 默认返回yyyy-MM-dd HH-mm-ss
const d = new Date();
const year = d.getFullYear();// 得到年
const month = (d.getMonth() + 1) < 10 ? '0' + (d.getMonth() + 1) : (d.getMonth() + 1);// 得到月
const day = d.getDate() < 10 ? '0' + d.getDate() : d.getDate();// 得到日
const hour = d.getHours() < 10 ? '0' + d.getHours() : d.getHours();// 得到时
const minute = d.getMinutes() < 10 ? '0' + d.getMinutes() : d.getMinutes();// 得到分
const second = d.getSeconds() < 10 ? '0' + d.getSeconds() : d.getSeconds();// 得到秒
return [ year, month, day ].join('-') + ' ' + [ hour, minute, second ].join(':');// 格式为:YY-MM-DD hh:mm:ss(当前时间)
},
// 标准号验证
validateStandNumber (standinfo) {
return new Promise((resolve, reject) => {
const obj = JSON.parse(JSON.stringify(standinfo))
console.log(obj)
this.$http.post('lawss/sarLawsInfo/validateStandNumber', obj, {
_this: this
}, res => {
if (res.ok) {
resolve(true)
} else {
/* this.$Modal.error({
title: '提示消息',
content: res.message
}); */
resolve(false)
}
}, e => {
reject(e)
})
})
},
// #region
// addModal () {
// this.sarLawsStandEO = {...this.defaultAddFormField}
// this.sarLawsStandEO.menuId = this.selectSarMenu.id
// // this.getOrgTreeSource()
// this.drawerTitle = '新增企业标准'
// this.formdisableflag = false
// this.addOrUPdateFlag = 1
// this.sarLawsStandEO.orgName = ''
// this.resolveFormFieldList()
// Promise.all([this.queryDisplayLocation()]).then((values) => {
// const [displayLocation] = values
// const dynamicFormField = this.sarLawsStandEO
// const formFieldList = this.formFieldList
// formFieldList.forEach((field) => {
// displayLocation.forEach((location) => {
// let value = dynamicFormField[field.attrField]
// let valueName = ''
// if (value && typeof value === 'number') {
// value = this.$dateFormat(value, 'yyyy-MM-dd')
// }
// field['value'] = value
// // 追加用户名称和部门名称
// if (field.selVal === 'ORGLIST' || field.selVal === 'USERLIST') {
// 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
// this.modalshowflag = true
// })
// },
// #endregion
getDicTypeListCode () {
// 查询各下拉框数据
this.$http.get('sys/dictype/getDicTypeListCode', '', {
_this: this
}, res => {
this.allSelectOptions = res.data || {}
this.countryOptions = res.data.COUNTRY
this.applyCountryOptions = res.data.COUNTRY
this.regionOptions = res.data.REGION // 区域
this.standStateOptions = res.data.BUSSSTATE
this.energyKindOptions = res.data.ENERGYTYPES
this.standGeneraOptions = res.data.BUSSBIGCLASS
this.standSubclassOptions = res.data.BUSSFINECLASS
this.standSortOptions = res.data.STANDCLASSIFY // 标准类别
this.standNatureOptions = res.data.SARPROPERTY // 标准性质
this.standStateOptions = res.data.TEXTSTATUSBUSS // 标准状态
this.standSystemOptions = res.data.TXLBBUSS // 标准体系
this.applyArcticOptions = res.data.ENERGYTYPES // 适用车型
this.categoryOptions = res.data.NYLXCLASS // 能源类型
this.applyAuthOptions = res.data.SYRZCLASS // 适用认证
this.cysdOptions = res.data.WSCYSD // 我司参与深度
this.zrgcsOptions = res.data.ZRGCSCLASS // 责任工程师
this.txlbOptions = res.data.TXLBCLASS // 体系类别
this.qcdwOptions = res.data.QCDW // 起草单位
this.qcrOptions = res.data.QCRBUSS // 起草人
this.nylxOptions = res.data.NYLXCLASS // 能源类型
this.syrzOptions = res.data.SYRZCLASS // 适用认证
this.sycpxOptions = res.data.SYCPXCLASS // 适用产品线
this.zrgcsOptions = res.data.ZRGCSCLASS // 责任工程师
this.zrbmOptions = res.data.ZRBMCLASS // 责任部门
this.gkglbmOptions = res.data.GKGLBM // 归口管理部门
this.lawsTypeOptions = res.data.lawsType
this.lawsTypeFirstLevelOptions = res.data.lawsTypeFirstLevel
this.lawsTypeSecondLevelOptions = res.data.lawsTypeSecondLevel
this.lawsTypeThirdLevelOptions = res.data.lawsTypeThirdLevel
this.lawsTypeFourthLevelOptions = res.data.lawsTypeFourthLevel
this.lawsTextStateOptions = res.data.lawsTextState
this.lawsSyqyOptions = res.data.lawsSyqy
this.lawsSycxOptions = res.data.lawsSycx
this.lawsYearOptions = res.data.lawsYear
this.lawsLabelOptions = res.data.lawsLabel
this.CYSDLAWSOptions = res.data.CYSDLAWS
this.TGRLAWSOptions = res.data.TGRLAWS
this.TGDWLAWSOptions = res.data.TGDWLAWS
this.NYLXLAWSOptions = res.data.NYLXLAWS
this.YYRZLAWSOptions = res.data.YYRZLAWS
this.ZRBMLAWSOptions = res.data.ZRBMLAWS
this.ZRGCSLAWSOptions = res.data.ZRGCSLAWS
// this.classifyCodeOptions = res.data.STANDCLASSIFY
}, e => {
})
},
choice (type, title, nameId) {
this.nodeList = []
if (nameId) {
const nameId1 = nameId.split(',')
let idList = []
nameId1.forEach(item => {
let a, b
a = item.substring(item.indexOf('(') + 1)
b = a.substring(0, a.lastIndexOf(')'))
idList.push(b)
})
idList = idList.join(',')
// 管理员(admin),张兰英(zhanglanying) => ['admin', 'zhanglanying']
this.nodeList = idList.split(',')
}
this.choiceTitle = title
this.modalShowRoleFlag = true
},
choiceZRBM (type, title, id = '') {
this.nodeListDep = []
if (id) {
this.$set(this, 'nodeListDep', id.split(','))
}
this.choiceTitle = title
this.modalShowDepFlag = true
},
checkedRole (data) {
let idList = ''
let nameList = ''
data.forEach(item => {
if (nameList.length > 0) {
nameList += ','
idList += ','
}
idList += item.id
nameList += item.name
})
let field = ''
switch (this.choiceTitle) {
case '选择投稿人':
field = 'TGRLAWS'
break
case '选择责任工程师':
field = 'ZRGCSLAWS'
break
}
this.$set(this.sarLawsStandEO, field, nameList)
if (this.choiceTitle === '选择投稿人') {
// 带入投稿单位
this.sarLawsStandEO.TGDWLAWSID = this.unique(data.map(item => item.topUnitId)).join(',')
this.sarLawsStandEO.TGDWLAWS = this.unique(data.map(item => item.topUnit)).join(',')
}
},
unique (newArr) {
const res = new Map();
return newArr.filter((newArr) => !res.has(newArr) && res.set(newArr, 1));
},
drawerCheckDep (data) {
let idList = ''
let nameList = ''
data.forEach(item => {
if (nameList.length > 0) {
nameList += ','
idList += ','
}
idList += item.id
nameList += item.name
})
let field = ''
let id = ''
switch (this.choiceTitle) {
case '选择投稿单位':
id = 'TGDWLAWSID'
field = 'TGDWLAWS'
break
case '选择责任部门':
field = 'ZRBMLAWS'
id = 'ZRBMLAWSID'
break
}
this.sarLawsStandEO[id] = idList;
this.sarLawsStandEO[field] = nameList;
},
},
}
</script>
<style scoped lang="less">
.lawsKeyPoint{
/deep/ .add-form-item{
border-bottom: 0;
}
}
.drawer-content {
padding: 0 19px;
overflow-y: auto;
flex: auto;
}
.drawer-footer {
width: 100%;
padding: 0 20px;
height: 70px;
line-height: 69px;
border-top: 1px solid #e8e8e8;
text-align: right;
background: #fff;
z-index: 999;
}
</style>