feat: 标准库 编辑对应属性字段 体系树结构

This commit is contained in:
super_liu
2021-07-09 18:14:50 +08:00
parent 9db377e50f
commit 74e83d6111
3 changed files with 386 additions and 112 deletions
@@ -274,92 +274,132 @@
: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="country" label-width="150px" class="add-form-item form-item-disabled">
<el-select v-model="sarStandardsInfoEO.country" disabled >
<el-option v-for="opt in countryOptions" :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="标准类别" 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.textStatus"
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>-->
<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>
<!-- <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="country" label-width="150px" class="add-form-item form-item-disabled">-->
<!-- <el-select v-model="sarStandardsInfoEO.country" disabled >-->
<!-- <el-option v-for="opt in countryOptions" :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="文本说明" 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-if="index === 0" >
<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 prop="standNature" label-width="150px" class="add-form-item">
<template slot="label">标准性质</template>
<el-select v-model="sarStandardsInfoEO.standNature"
placeholder="请选择标准性质"
clearable>
<el-option
v-for="item in standNatureOptions"
placeholder="请选择"
:key="item.value"
:value="item.value"
:label="item.label"
>
{{ item.label }}
</el-option>
</el-select>
</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.textStatus"
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>-->
<el-form-item
prop="isRelateAccess"
label-width="150px"
class="add-form-item"
>
<template slot="label">是否纳入认证清单</template>
<el-select v-model="sarStandardsInfoEO.isRelateAccess" @change="isRegulationsChange">
<el-option value="1" label="是" key="1"></el-option>
<el-option value="2" label="否" key="2"></el-option>
</el-select>
</el-form-item>
<el-form-item
prop="standSystem"
label-width="150px"
class="add-form-item"
>
<template slot="label">标准体系</template>
<tree-select
:data="standSystemOptions"
:defaultProps="defaultProps" :checkedKeys="defaultCheckedKeys"
:nodeKey="nodeKey" @popoverHide="popoverHide"></tree-select>
</el-form-item>
</template>
<template v-for="field in displayLocation.child">
<template v-if="field.attrField === 'EOPSSRQ'">
<custom-eop-date-pick
@@ -1013,6 +1053,7 @@ import CustomRoleTree from '@/components/CustomFormComponents/roleTree'
import Bus from '@/common/eventHub'
import CustomDatePickWithText2 from '@/components/CustomFormComponents/DatePickerWithText2'
import { interfaceUrl } from '@/sysConfig'
import TreeSelect from '@/components/treeSelect/treeSelect.vue';
export default {
name: 'domesticStandardsAndRegulations',
@@ -1032,7 +1073,8 @@ export default {
CustomDatePickWithText,
CustomSVPPS,
CustomRoleTree,
CustomDatePickWithText2
CustomDatePickWithText2,
TreeSelect
},
data () {
return {
@@ -1041,6 +1083,12 @@ export default {
children: 'children'
},
treeList: [],
defaultProps: {
children: 'children',
label: 'menuName'
},
nodeKey: 'id',
defaultCheckedKeys: [],
exportLoading : false,
visibleOrgTable: false,
orgTableVal: '',
@@ -1138,11 +1186,17 @@ export default {
stahndinfoList: [],
tableFlag: '',
countryOptions: [],
cysdOptions: [], // 我司参与深度下拉框
sycpxOptions: [], // 适用产品线下拉框
zrbmOptions: [], // 责任部门下拉框
zrgcsOptions: [], // 责任工程师下拉框
txlbOptions: [], // 体系类别下拉框
regionOptions: [], // 区域
standSortOptions: [], // 标准类别下拉框
standSortConfigOptions: [], // 标准类别下拉框
applyArcticOptions: [], // 适用车型下拉框
standStateOptions: [], // 文本状态下拉框
standSystemOptions: [], // 标准体系下拉框
standNatureOptions: [], // 标准性质下拉框
adoptExtentOptions: [], // 采标程度下拉框
emergyKindOptions: [], // 能源种类下拉框
@@ -1247,6 +1301,7 @@ export default {
applyArctic: '',
standNumber: '',
standYear: '',
standSystem: '',
standName: '',
standEnName: '',
standState: '',
@@ -1436,16 +1491,16 @@ export default {
{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'}
],
isRelateAccess: [
{ required: true, message: '重要度不能为空', trigger: 'change' }
],
issueTime:[
{required: true, message: '发布日期不能为空', trigger: 'change'}
]
// standEnName: [
// {required: true, message: '英文名称不能为空', trigger: 'change'},
// {type: 'string', max: 1000, message: '英文名称不能超过1000个字符', trigger: 'change'}
// ],
// isRelateAccess: [
// { required: true, message: '重要度不能为空', trigger: 'change' }
// ],
// issueTime:[
// {required: true, message: '发布日期不能为空', trigger: 'change'}
// ]
},
sarStandardsInfoRules: {
standSort: [
@@ -1598,6 +1653,12 @@ export default {
}
},
methods: {
popoverHide (checkedIds, checkedData) {
console.log(checkedIds);
console.log(checkedData);
this.sarStandardsInfoEO.standSystem = checkedData.id
console.log(this.sarStandardsInfoEO.standSystem);
},
closeModal () {
this.productModal = false
this.closeDrawer()
@@ -1833,7 +1894,8 @@ export default {
const [displayLocation] = values
const formFieldList = this.formFieldList
this.sarStandardsInfoEO = JSON.parse(JSON.stringify(item))
this.sarStandardsInfoEO.standSort = item.standSort
this.defaultCheckedKeys = [this.sarStandardsInfoEO.standSystem];
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)
@@ -2124,6 +2186,16 @@ export default {
}
})
},
// 查询所有菜单
selectStandardMenu () {
this.$http.get('lawss/sarMenuStandard', {
dicId: this.dictionaryId
}, {}, res => {
if (res.ok) {
this.data = res.data
}
})
},
// 树-删除
sureDeleteSarMenu () {
this.$confirm('是否删除?', '提示', {
@@ -2582,6 +2654,7 @@ export default {
if (flag) {
// 时间格式修改
let nowstandinfo = JSON.parse(JSON.stringify(this.sarStandardsInfoEO))
console.log(nowstandinfo)
if (nowstandinfo.putTime != null && nowstandinfo.putTime !== '') {
nowstandinfo.putTime = this.$dateFormat(this.sarStandardsInfoEO.putTime, 'yyyy-MM-dd hh:mm:ss')
}
@@ -2611,7 +2684,9 @@ export default {
sarStandAttrObj[item.attrField] = nowstandinfo[item.attrField]
})
nowstandinfo['sarStandAttrEOStr'] = JSON.stringify(sarStandAttrObj).replace(/"/g, "'")
this.$http.postData(this.addOrUPdateFlag === 1 ? 'sarStandardsInfo/sar-standards-info/addarStandardsInfo' : 'lawss/sarStandardsInfo/updateSarStandardsInfo', nowstandinfo, {
console.log(formFieldList)
console.log(nowstandinfo)
this.$http.postData(this.addOrUPdateFlag === 1 ? 'sarStandardsInfo/sar-standards-info/addarStandardsInfo' : 'sarStandardsInfo/sar-standards-info/updateSarStandardsInfo', nowstandinfo, {
_this: this
}, res => {
this.isSubmit = false
@@ -3596,7 +3671,7 @@ export default {
* 动态改变必填项
* */
isRegulationsChange (val) {
if (val === '0') {
if (val === '2') {
const formFieldList = this.formFieldList
const rules = {...this.defaultAddFormFieldRules}
formFieldList.forEach((item) => {
@@ -3807,28 +3882,31 @@ export default {
}
}
},
async mounted () {
created(){
},
async mounted () {
// 进入页面后查询树形结构目录
await this.selectMenu()
// 进入页面后查询标准体系树形结构目录
await this.selectStandardMenu()
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.allSelectOptions = res.data || {}
this.standSortOptions = res.data.STANDCLASSIFY // 标准类别
this.standNatureOptions = res.data.SARPROPERTY // 标准性质
this.standStateOptions = res.data.WBZTCLASS // 文本状态
this.standSystemOptions = res.data.BZTXCLASS // 标准体系
this.applyArcticOptions = res.data.ENERGYTYPES // 适用车型
this.categoryOptions = res.data.NYLXCLASS // 能源类型
this.applyAuthOptions = res.data.SYRZCLASS // 适用认证
this.cysdOptions = res.data.WSCYSD // 我司参与深度
this.sycpxOptions = res.data.SYCPXCLASS // 适用产品线
this.zrbmOptions = res.data.ZRBMCLASS // 责任部门
this.zrgcsOptions = res.data.ZRGCSCLASS // 责任工程师
this.txlbOptions = res.data.TXLBCLASS // 体系类别
this.getGzzOption()
}, e => {
})