862 lines
38 KiB
Vue
862 lines
38 KiB
Vue
<template>
|
|
<a-spin :spinning="loading">
|
|
<a-form-model :model="formInline" :rules="rules" ref="ruleForm">
|
|
<div class="form-flex-box">
|
|
<!-- 制修订类型 -->
|
|
<div class="box-title-text form-flex-item">
|
|
<div class="title-text">
|
|
<span class="required">*</span>
|
|
<span class="title-text-text" :title="$t('workCenter.enterpriseInitChangePlan.typeOfRevision')">
|
|
{{ $t('workCenter.enterpriseInitChangePlan.typeOfRevision') }}
|
|
</span>
|
|
</div>
|
|
<a-form-model-item class="item-model">
|
|
<a-input class="box-input"
|
|
:maxLength="50"
|
|
defaultValue="更改"
|
|
disabled
|
|
:placeholder="$t('pleaseEnter')+$t('workCenter.enterpriseInitChangePlan.typeOfRevision')" />
|
|
</a-form-model-item>
|
|
</div>
|
|
<!-- 企标编号 -->
|
|
<div class="box-title-text form-flex-item">
|
|
<div class="title-text">
|
|
<span class="required">*</span>
|
|
<span class="title-text-text" :title="$t('workCenter.enterpriseInitChangePlan.enterpriseStandardNum')">
|
|
{{ $t('workCenter.enterpriseInitChangePlan.enterpriseStandardNum') }}
|
|
</span>
|
|
</div>
|
|
<a-form-model-item class="item-model" prop="standardNumber">
|
|
<standard-selection :source="StandardSource.ENTERPRISE.value"
|
|
:placeholder="$t('pleaseSelect') + $t('workCenter.enterpriseInitChangePlan.enterpriseStandardNum')"
|
|
:disabled="disabled"
|
|
:disabledSourceSearch="true"
|
|
type="radio"
|
|
:selectOnly="true"
|
|
:filters="{standardState: '1,2,3,4,5,6,7,8'}"
|
|
v-model="formInline.standardNumber"
|
|
@listChange="listChange" />
|
|
</a-form-model-item>
|
|
</div>
|
|
<!-- 企标名称 -->
|
|
<div class="box-title-text form-flex-item">
|
|
<div class="title-text">
|
|
<span class="required">*</span>
|
|
<span class="title-text-text" :title="$t('workCenter.enterpriseInitChangePlan.enterpriseStandardName')">
|
|
{{ $t('workCenter.enterpriseInitChangePlan.enterpriseStandardName') }}
|
|
</span>
|
|
</div>
|
|
<a-form-model-item class="item-model" prop="standardName">
|
|
<a-input class="box-input"
|
|
v-model="formInline.standardName"
|
|
:maxLength="200"
|
|
:disabled="disabled"
|
|
:placeholder="$t('pleaseEnter')+$t('workCenter.enterpriseInitChangePlan.enterpriseStandardName')" />
|
|
</a-form-model-item>
|
|
</div>
|
|
<!-- 标准等级分类 -->
|
|
<div class="box-title-text form-flex-item">
|
|
<div class="title-text">
|
|
<span class="title-text-text" :title="$t('workCenter.enterpriseInitChangePlan.standardGradeClassification')">
|
|
{{ $t('workCenter.enterpriseInitChangePlan.standardGradeClassification') }}
|
|
</span>
|
|
</div>
|
|
<a-form-model-item class="item-model" prop="gradeClassification">
|
|
<j-dict-select-tag class="box-input"
|
|
:disabled="disabled"
|
|
v-model="formInline.gradeClassification"
|
|
:placeholder="$t('pleaseSelect')+$t('workCenter.enterpriseInitChangePlan.standardGradeClassification')"
|
|
:type="'select'"
|
|
:triggerChange="false"
|
|
dictCode="standard_grade_classify" />
|
|
</a-form-model-item>
|
|
</div>
|
|
<!-- 授权部门 -->
|
|
<div class="box-title-text form-flex-item">
|
|
<div class="title-text">
|
|
<span class="title-text-text" :title="$t('workCenter.enterpriseInitChangePlan.authorizationDepart')">
|
|
{{ $t('workCenter.enterpriseInitChangePlan.authorizationDepart') }}
|
|
</span>
|
|
</div>
|
|
<a-form-model-item class="item-model" prop="authDept">
|
|
<j-select-depart v-model="formInline.authDept"
|
|
:disabled="disabled || authDeptDisabled"
|
|
:selectRange="departSelectRange"
|
|
:multi="true"
|
|
:backDepart="true"
|
|
:treeOpera="true" />
|
|
</a-form-model-item>
|
|
</div>
|
|
<!-- 标准体系 -->
|
|
<div class="box-title-text form-flex-item">
|
|
<div class="title-text">
|
|
<span class="required">*</span>
|
|
<span class="title-text-text" :title="$t('workCenter.enterpriseInitChangePlan.standardSystem')">
|
|
{{ $t('workCenter.enterpriseInitChangePlan.standardSystem') }}
|
|
</span>
|
|
</div>
|
|
<a-form-model-item class="item-model" prop="standardSystem">
|
|
<s-tree-select
|
|
v-model="formInline.standardSystem"
|
|
:disabled="disabled"
|
|
:tree-data="standardSystemOptions"
|
|
tree-checkable
|
|
treeCheckStrictly
|
|
:placeholder="$t('pleaseSelect')+$t('workCenter.enterpriseInitChangePlan.standardSystem')" />
|
|
</a-form-model-item>
|
|
</div>
|
|
<!-- 标准英文名称 -->
|
|
<div class="box-title-text form-flex-item">
|
|
<div class="title-text">
|
|
<span class="title-text-text" :title="$t('workCenter.enterpriseInitChangePlan.standardEnglishName')">
|
|
{{ $t('workCenter.enterpriseInitChangePlan.standardEnglishName') }}
|
|
</span>
|
|
</div>
|
|
<a-form-model-item class="item-model" prop="standardEnglishName">
|
|
<a-input class="box-input"
|
|
:disabled="disabled"
|
|
v-model="formInline.standardEnglishName"
|
|
:maxLength="500"
|
|
:placeholder="$t('pleaseEnter')+$t('workCenter.enterpriseInitChangePlan.standardEnglishName')" />
|
|
</a-form-model-item>
|
|
</div>
|
|
<!-- 发布日期 -->
|
|
<div class="box-title-text form-flex-item">
|
|
<div class="title-text title-text-long">
|
|
<span class="required">*</span>
|
|
<span class="title-text-text" :title="$t('workCenter.enStandardChange.releaseDate')">
|
|
{{ $t('workCenter.enStandardChange.releaseDate') }}
|
|
</span>
|
|
</div>
|
|
<a-form-model-item class="item-model" prop="releaseDate">
|
|
<a-date-picker
|
|
v-model="formInline.releaseDate"
|
|
:showTime="false"
|
|
:disabled="disabled"
|
|
value-format="YYYY-MM-DD">
|
|
</a-date-picker>
|
|
</a-form-model-item>
|
|
</div>
|
|
<!-- 实施日期 -->
|
|
<div class="box-title-text form-flex-item">
|
|
<div class="title-text title-text-long">
|
|
<span class="required">*</span>
|
|
<span class="title-text-text" :title="$t('workCenter.enStandardChange.materialDate')">
|
|
{{ $t('workCenter.enStandardChange.materialDate') }}
|
|
</span>
|
|
</div>
|
|
<a-form-model-item class="item-model" prop="implementationDate">
|
|
<a-date-picker
|
|
v-model="formInline.implementationDate"
|
|
:showTime="false"
|
|
:disabled="disabled"
|
|
value-format="YYYY-MM-DD">
|
|
</a-date-picker>
|
|
</a-form-model-item>
|
|
</div>
|
|
<!-- 是否试行 -->
|
|
<div class="box-title-text form-flex-item">
|
|
<div class="title-text">
|
|
<span class="title-text-text" :title="$t('workCenter.enStandardChange.isTry')">
|
|
{{ $t('workCenter.enStandardChange.isTry') }}
|
|
</span>
|
|
</div>
|
|
<a-form-model-item class="item-model" prop="tryFlag">
|
|
<j-dict-select-tag class="box-input"
|
|
:disabled="disabled"
|
|
v-model="formInline.tryFlag"
|
|
:placeholder="$t('pleaseSelect')+$t('workCenter.enStandardChange.isTry')"
|
|
:type="'select'"
|
|
:triggerChange="false"
|
|
dictCode="is_trial" />
|
|
</a-form-model-item>
|
|
</div>
|
|
<!-- 试行周期 -->
|
|
<div class="box-title-text form-flex-item">
|
|
<div class="title-text">
|
|
<span v-if="rules.trialPeriod[0].required" class="required">*</span>
|
|
<span class="title-text-text" :title="$t('workCenter.enStandardChange.trialPeriod')">
|
|
{{ $t('workCenter.enStandardChange.trialPeriod') }}
|
|
</span>
|
|
</div>
|
|
<a-form-model-item class="item-model" prop="trialPeriod">
|
|
<j-dict-select-tag class="box-input"
|
|
:disabled="disabled"
|
|
v-model="formInline.trialPeriod"
|
|
:placeholder="$t('pleaseSelect')+$t('workCenter.enStandardChange.trialPeriod')"
|
|
:type="'select'"
|
|
:triggerChange="false"
|
|
dictCode="trial_period" />
|
|
</a-form-model-item>
|
|
</div>
|
|
<!-- 零部件分类 -->
|
|
<div class="box-title-text form-flex-item">
|
|
<div class="title-text">
|
|
<span class="required">*</span>
|
|
<span class="title-text-text" :title="$t('workCenter.enterpriseInitChangePlan.partName')">
|
|
{{ $t('workCenter.enterpriseInitChangePlan.partName') }}
|
|
</span>
|
|
</div>
|
|
<a-form-model-item class="item-model" prop="partName">
|
|
<!-- <tree-selection :placeholder="$t('pleaseSelect')+$t('workCenter.enterpriseInitChangePlan.partName')"-->
|
|
<!-- v-model="formInline.partName"-->
|
|
<!-- @nameChange="treeSelectNameChange"-->
|
|
<!-- filedName="partName"-->
|
|
<!-- type="checkbox"-->
|
|
<!-- :nameStr="formInline.partName_dictText"-->
|
|
<!-- options-href="/laws/standard/partName/"-->
|
|
<!-- :disabled="disabled" />-->
|
|
<tree-data-selection :placeholder="$t('pleaseSelect')+$t('workCenter.enterpriseInitChangePlan.partName')"
|
|
v-model="formInline.partName"
|
|
fieldName="partName"
|
|
:nameStr="formInline.partName_dictText"
|
|
@nameChange="treeSelectNameChange"
|
|
optionsHref="/laws/standard/partName/queryFirstList"
|
|
dict-id="1696007957666533377"
|
|
:disabled="disabled"/>
|
|
</a-form-model-item>
|
|
</div>
|
|
<!-- 主起草人 -->
|
|
<div class="box-title-text form-flex-item">
|
|
<div class="title-text">
|
|
<span class="title-text-text" :title="$t('workCenter.enterpriseInitChangePlan.principalDrafter')">
|
|
{{ $t('workCenter.enterpriseInitChangePlan.principalDrafter') }}
|
|
</span>
|
|
</div>
|
|
<a-form-model-item class="item-model" prop="mainDraftingUser">
|
|
<user-selection :placeholder="$t('pleaseSelect')+$t('workCenter.enterpriseInitChangePlan.principalDrafter')"
|
|
v-model="formInline.mainDraftingUser"
|
|
:disabled="disabled"
|
|
filedName="mainDraftingUser"
|
|
@nameChange="userSelectNameChange"
|
|
:nameStr="formInline.mainDraftingUser_dictText"
|
|
type="radio" />
|
|
</a-form-model-item>
|
|
</div>
|
|
<!-- 主起草单位 -->
|
|
<div class="box-title-text form-flex-item">
|
|
<div class="title-text">
|
|
<span class="required">*</span>
|
|
<span class="title-text-text" :title="$t('workCenter.enterpriseInitChangePlan.mainDraftUnit')">
|
|
{{ $t('workCenter.enterpriseInitChangePlan.mainDraftUnit') }}
|
|
</span>
|
|
</div>
|
|
<a-form-model-item class="item-model" prop="mainDraftingUnit">
|
|
<j-select-depart v-model="formInline.mainDraftingUnit"
|
|
:disabled="disabled"
|
|
:isSomeDisabled="true"
|
|
:backDepart="true" />
|
|
</a-form-model-item>
|
|
</div>
|
|
<!-- 标准适用范围 -->
|
|
<div class="box-title-text form-flex-item">
|
|
<div class="title-text title-text-long">
|
|
<span class="title-text-text" :title="$t('workCenter.enStandardChange.scopeOfApplication')">
|
|
{{ $t('workCenter.enStandardChange.scopeOfApplication') }}
|
|
</span>
|
|
</div>
|
|
<a-form-model-item class="item-model" prop="standardScope">
|
|
<a-textarea :placeholder="$t('pleaseEnter')+$t('workCenter.enStandardChange.scopeOfApplication')"
|
|
:maxLength="500"
|
|
:disabled="disabled"
|
|
v-model="formInline.standardScope" :rows="4" />
|
|
</a-form-model-item>
|
|
</div>
|
|
<!-- 代替标准号 -->
|
|
<div class="box-title-text form-flex-item">
|
|
<div class="title-text">
|
|
<span class="title-text-text" :title="$t('workCenter.enStandardChange.substituteStandardNumber')">
|
|
{{ $t('workCenter.enStandardChange.substituteStandardNumber') }}
|
|
</span>
|
|
</div>
|
|
<a-form-model-item class="item-model" prop="substituteStandardNumber">
|
|
<standard-selection :source="StandardSource.ENTERPRISE.value"
|
|
:placeholder="$t('pleaseSelectStandard')"
|
|
:disabled="disabled"
|
|
:disabledSourceSearch="true"
|
|
:exclude-standard-numbers="formInline.standardNumber"
|
|
type="checkbox"
|
|
v-model="formInline.substituteStandardNumber" />
|
|
</a-form-model-item>
|
|
</div>
|
|
<!-- 引用标准 -->
|
|
<div class="box-title-text form-flex-item">
|
|
<div class="title-text">
|
|
<span class="title-text-text" :title="$t('workCenter.enStandardChange.quotedStandard')">
|
|
{{ $t('workCenter.enStandardChange.quotedStandard') }}
|
|
</span>
|
|
</div>
|
|
<a-form-model-item class="item-model" prop="referenceStandard">
|
|
<standard-selection :source="StandardSource.ENTERPRISE.value"
|
|
:placeholder="$t('pleaseSelectStandard')"
|
|
:disabled="disabled"
|
|
:exclude-standard-numbers="formInline.standardNumber"
|
|
type="checkbox"
|
|
v-model="formInline.referenceStandard" />
|
|
</a-form-model-item>
|
|
</div>
|
|
<!-- 关联文件 -->
|
|
<div class="box-title-text form-flex-item">
|
|
<div class="title-text title-text-long">
|
|
<span class="title-text-text" :title="$t('workCenter.enStandardChange.relevantFile')">
|
|
{{ $t('workCenter.enStandardChange.relevantFile') }}
|
|
</span>
|
|
</div>
|
|
<a-form-model-item class="item-model" prop="associatedFile">
|
|
<a-button type="primary" class="button-text" style="width: 100%" @click="clickButtonToUpload('associatedFile')">
|
|
{{
|
|
(formInline.associatedFile === 'null' || formInline.associatedFile === ''
|
|
|| formInline.associatedFile === null || formInline.associatedFile === undefined)
|
|
? $t('uploadFile.clickUpload')
|
|
: $t('uploadFile.viewUploadedFiles')
|
|
}}
|
|
</a-button>
|
|
</a-form-model-item>
|
|
</div>
|
|
<!-- 采标程度 -->
|
|
<div class="box-title-text form-flex-item">
|
|
<div class="title-text">
|
|
<span class="title-text-text" :title="$t('workCenter.enStandardChange.degreeOfBidAcquisition')">
|
|
{{ $t('workCenter.enStandardChange.degreeOfBidAcquisition') }}
|
|
</span>
|
|
</div>
|
|
<a-form-model-item class="item-model" prop="acquisitionDegree">
|
|
<j-dict-select-tag class="box-input"
|
|
:disabled="disabled"
|
|
v-model="formInline.acquisitionDegree"
|
|
:placeholder="$t('pleaseSelect')+$t('workCenter.enStandardChange.degreeOfBidAcquisition')"
|
|
:type="'select'"
|
|
:triggerChange="false"
|
|
dictCode="degree_bid_acquisition" />
|
|
</a-form-model-item>
|
|
</div>
|
|
<!-- 采用国际标准号 -->
|
|
<div class="box-title-text form-flex-item">
|
|
<div class="title-text">
|
|
<span class="title-text-text" :title="$t('workCenter.enStandardChange.adoptInternationalStandardNumber')">
|
|
{{ $t('workCenter.enStandardChange.adoptInternationalStandardNumber') }}
|
|
</span>
|
|
</div>
|
|
<a-form-model-item class="item-model" prop="internationalStandardNum">
|
|
<a-input class="box-input"
|
|
v-model="formInline.internationalStandardNum"
|
|
:disabled="disabled"
|
|
:maxLength="50"
|
|
:placeholder="$t('pleaseEnter')+$t('workCenter.enStandardChange.adoptInternationalStandardNumber')" />
|
|
</a-form-model-item>
|
|
</div>
|
|
<!-- 标准拆分状态 -->
|
|
<div class="box-title-text form-flex-item">
|
|
<div class="title-text">
|
|
<span class="title-text-text" :title="$t('workCenter.enStandardChange.standardSplitStatus')">
|
|
{{ $t('workCenter.enStandardChange.standardSplitStatus') }}
|
|
</span>
|
|
</div>
|
|
<a-form-model-item class="item-model" prop="standardSplitStatus">
|
|
<j-dict-select-tag class="box-input"
|
|
:disabled="disabled"
|
|
v-model="formInline.standardSplitStatus"
|
|
:placeholder="$t('pleaseSelect')+$t('workCenter.enStandardChange.standardSplitStatus')"
|
|
:type="'select'"
|
|
:triggerChange="false"
|
|
dictCode="standard_split_status" />
|
|
</a-form-model-item>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 上传文件弹框 -->
|
|
<upload-file ref="uploadFile" @change="uploadFileChange" :return-url="false" :disabled="disabled"></upload-file>
|
|
</a-form-model>
|
|
</a-spin>
|
|
</template>
|
|
|
|
<script>
|
|
import { StandardSource, StandardGradeClassify, IsTrial } from '@/enums/commonEnums'
|
|
import { getTreeList, getEnterpriseStandardInfoById, getStandardGradeClassification } from '@/api/enterpriseStandardLibraryApi'
|
|
import StandardSelection from '@/components/selection/StandardSelection'
|
|
import UserSelection from '@/components/selection/UserSelection'
|
|
import UploadFile from '@/components/UploadFile'
|
|
import TreeSelection from '@/components/selection/TreeSelection'
|
|
import STreeSelect from '@/components/STreeSelect'
|
|
import TreeDataSelection from '../../../../components/selection/TreeDataSelection'
|
|
|
|
export default {
|
|
name: 'BaseInfoForm',
|
|
components: {
|
|
StandardSelection,
|
|
UserSelection,
|
|
UploadFile,
|
|
TreeSelection,
|
|
STreeSelect,
|
|
TreeDataSelection
|
|
},
|
|
props: {
|
|
disabled: {
|
|
type: Boolean,
|
|
required: false,
|
|
default: false
|
|
}
|
|
},
|
|
watch: {
|
|
// 企标编号监视
|
|
'formInline.standardNumber' (value) {
|
|
this.$emit('processNameChange', (value || '') + '-' + (this.formInline.standardName || '') + '-' + '企标更改')
|
|
},
|
|
// 企标名称监视
|
|
'formInline.standardName' (value) {
|
|
this.$emit('processNameChange', (this.formInline.standardNumber || '') + '-' + (value || '') + '-' + '企标更改')
|
|
},
|
|
// 标准等级分类改变后授权部门需要自动带出
|
|
'formInline.gradeClassification' (val) {
|
|
console.log(val, this.isEditSetData, this.formInline.authDept)
|
|
if (val && !this.isEditSetData) {
|
|
if (val === StandardGradeClassify.ZERO_LEVEL.value) {
|
|
// 选的是0级,授权部门带出不可编辑
|
|
this.formInline.authDept = this.standardGradeClassification.find(item => item.level + '' === '0').deptIds
|
|
if (!this.authDeptDisabled) {
|
|
this.authDeptDisabled = true
|
|
}
|
|
} else if (val === StandardGradeClassify.ONE_LEVEL.value) {
|
|
// 选的是1级,带出主起草单位
|
|
this.formInline.authDept = this.formInline.mainDraftingUnit
|
|
// 设置可选择项
|
|
this.departSelectRange = this.standardGradeClassification.find(item => item.level + '' === '1').deptIds.split(',')
|
|
this.formInline = JSON.parse(JSON.stringify(this.formInline))
|
|
// 设置授权部门可编辑
|
|
if (this.authDeptDisabled) {
|
|
this.authDeptDisabled = false
|
|
}
|
|
} else if (val === StandardGradeClassify.TWO_LEVEL.value) {
|
|
// 选的是2级,带出主起草单位
|
|
this.formInline.authDept = this.formInline.mainDraftingUnit
|
|
// 设置可选择项
|
|
this.departSelectRange = this.standardGradeClassification.find(item => item.level + '' === '2').deptIds.split(',')
|
|
this.formInline = JSON.parse(JSON.stringify(this.formInline))
|
|
// 设置授权部门可编辑
|
|
if (this.authDeptDisabled) {
|
|
this.authDeptDisabled = false
|
|
}
|
|
} else if (val === StandardGradeClassify.THREE_LEVEL.value) {
|
|
// 选的是3级,带出主起草单位
|
|
this.formInline.authDept = this.formInline.mainDraftingUnit
|
|
if (!this.authDeptDisabled) {
|
|
this.authDeptDisabled = true
|
|
}
|
|
}
|
|
} else if (val && this.isEditSetData) {
|
|
if (val === StandardGradeClassify.ZERO_LEVEL.value) {
|
|
// 选的是0级,授权部门带出不可编辑
|
|
if (!this.authDeptDisabled) {
|
|
this.authDeptDisabled = true
|
|
}
|
|
} else if (val === StandardGradeClassify.ONE_LEVEL.value) {
|
|
// 选的是1级
|
|
// 设置可选择项
|
|
this.departSelectRange = this.standardGradeClassification.find(item => item.level + '' === '1').deptIds.split(',')
|
|
// 设置授权部门可编辑
|
|
if (this.authDeptDisabled) {
|
|
this.authDeptDisabled = false
|
|
}
|
|
} else if (val === StandardGradeClassify.TWO_LEVEL.value) {
|
|
// 选的是2级
|
|
// 设置可选择项
|
|
this.departSelectRange = this.standardGradeClassification.find(item => item.level + '' === '2').deptIds.split(',')
|
|
// 设置授权部门可编辑
|
|
if (this.authDeptDisabled) {
|
|
this.authDeptDisabled = false
|
|
}
|
|
} else if (val === StandardGradeClassify.THREE_LEVEL.value) {
|
|
// 选的是3级,授权部门带出不可编辑
|
|
if (!this.authDeptDisabled) {
|
|
this.authDeptDisabled = true
|
|
}
|
|
}
|
|
} else if (!val) {
|
|
// 清空授权部门的可选项
|
|
this.departSelectRange = []
|
|
// 设置授权部门可编辑
|
|
this.authDeptDisabled = false
|
|
// 清空授权部门
|
|
this.formInline.authDept = ''
|
|
}
|
|
},
|
|
// 主起草单位改变后,需要将选中的主起草单位增加到授权部门
|
|
'formInline.mainDraftingUnit' (val) {
|
|
if (val && !this.isEditSetData) {
|
|
if (this.formInline.gradeClassification === StandardGradeClassify.ONE_LEVEL.value ||
|
|
this.formInline.gradeClassification === StandardGradeClassify.TWO_LEVEL.value) {
|
|
// 标准等级分类是1级或者2级需要,把主起草单位追加到授权部门
|
|
let authDeptArr = (this.formInline.authDept || '').split(',')
|
|
// 把旧的主起草部门刨出去,否则每换一次主起草单位都会累计到授权部门
|
|
authDeptArr = authDeptArr.filter(item => item !== this.oldMainDraftingUnit)
|
|
authDeptArr.push(val)
|
|
this.formInline.authDept = authDeptArr.join(',')
|
|
} else if (this.formInline.gradeClassification === StandardGradeClassify.THREE_LEVEL.value) {
|
|
// 标准等级分类是3级,把授权部门替换成主起草单位
|
|
this.formInline.authDept = val
|
|
}
|
|
}
|
|
this.oldMainDraftingUnit = val
|
|
},
|
|
// 企标是否试行改变,标准状态需要跟着变,试行周期必填校验也跟着变
|
|
'formInline.tryFlag' (val) {
|
|
if (val && !this.isEditSetData) {
|
|
if (val === IsTrial.YES.value) {
|
|
// 试行周期给默认值24
|
|
this.formInline.trialPeriod = '24'
|
|
// 试行,试行周期必填
|
|
this.rules.trialPeriod[0].required = true
|
|
} else {
|
|
// 试行周期置空
|
|
this.formInline.trialPeriod = undefined
|
|
// 不试行,试行周期非必填
|
|
this.rules.trialPeriod[0].required = false
|
|
}
|
|
} else if (val && this.isEditSetData) {
|
|
if (val === IsTrial.YES.value) {
|
|
// 试行,试行周期必填
|
|
this.rules.trialPeriod[0].required = true
|
|
} else {
|
|
// 不试行,试行周期非必填
|
|
this.rules.trialPeriod[0].required = false
|
|
}
|
|
}
|
|
}
|
|
},
|
|
data () {
|
|
return {
|
|
StandardSource,
|
|
loading: false,
|
|
isEditSetData: false, // 是否正在回显数据
|
|
authDeptDisabled: false, // 授权部门是否可以更改
|
|
departSelectRange: [], // 授权部门可选项
|
|
standardGradeClassification: [], // 企标级别映射
|
|
standardSystemOptions: [], // 标准体系下拉框数据
|
|
formInline: {},
|
|
rules: {
|
|
// 企标编号
|
|
standardNumber: [
|
|
{
|
|
required: true,
|
|
message: this.$t('workCenter.enterpriseInitChangePlan.enterpriseStandardNum') + this.$t('cannotEmpty'),
|
|
trigger: 'change'
|
|
}
|
|
],
|
|
// 企标名称
|
|
standardName: [
|
|
{
|
|
required: true,
|
|
message: this.$t('workCenter.enterpriseInitChangePlan.enterpriseStandardName') + this.$t('cannotEmpty'),
|
|
trigger: 'blur'
|
|
}
|
|
],
|
|
// 标准等级分类
|
|
gradeClassification: [
|
|
{
|
|
required: false,
|
|
message: this.$t('workCenter.enterpriseInitChangePlan.standardGradeClassification') + this.$t('cannotEmpty'),
|
|
trigger: 'change'
|
|
}
|
|
],
|
|
// 标准体系
|
|
standardSystem: [
|
|
{
|
|
required: true,
|
|
message: this.$t('workCenter.enterpriseInitChangePlan.standardSystem') + this.$t('cannotEmpty'),
|
|
trigger: 'change'
|
|
}
|
|
],
|
|
// 发布日期
|
|
releaseDate: [
|
|
{
|
|
required: true,
|
|
message: this.$t('workCenter.enStandardChange.releaseDate') + this.$t('cannotEmpty'),
|
|
trigger: 'change'
|
|
}
|
|
],
|
|
// 实施日期
|
|
implementationDate: [
|
|
{
|
|
required: true,
|
|
message: this.$t('workCenter.enStandardChange.materialDate') + this.$t('cannotEmpty'),
|
|
trigger: 'change'
|
|
}
|
|
],
|
|
// 零部件分类
|
|
partName: [
|
|
{
|
|
required: true,
|
|
message: this.$t('workCenter.enterpriseInitChangePlan.partName') + this.$t('cannotEmpty'),
|
|
trigger: 'change'
|
|
}
|
|
],
|
|
// 试行周期
|
|
trialPeriod: [
|
|
{
|
|
required: false,
|
|
message: this.$t('workCenter.enStandardChange.trialPeriod') + this.$t('cannotEmpty'),
|
|
trigger: 'change'
|
|
}
|
|
],
|
|
// 主起草单位
|
|
mainDraftingUnit: [
|
|
{
|
|
required: true,
|
|
message: this.$t('workCenter.enterpriseInitChangePlan.mainDraftUnit') + this.$t('cannotEmpty'),
|
|
trigger: 'change'
|
|
}
|
|
]
|
|
},
|
|
oldMainDraftingUnit: '' // 上一次的主起草单位
|
|
}
|
|
},
|
|
mounted () {
|
|
// 获取企标级别映射
|
|
this.initStandardGradeClassification()
|
|
// 获取标准体系下拉框数据
|
|
this.initStandardSystemOptions()
|
|
// 初始化标准拆分状态为更改未拆分
|
|
this.formInline.standardSplitStatus = 3
|
|
},
|
|
methods: {
|
|
setFormById (enStandardId) {
|
|
this.loading = true
|
|
this.isEditSetData = true
|
|
getEnterpriseStandardInfoById({ id: enStandardId, type: '2' }).then(res => {
|
|
if (res.success) {
|
|
const result = res.result
|
|
const formInline = {}
|
|
// 企标id
|
|
formInline.standardId = result.id
|
|
// 企标编号
|
|
formInline.standardNumber = result.standard_number
|
|
// 企标名称
|
|
formInline.standardName = result.standard_name
|
|
// 标准等级分类
|
|
formInline.gradeClassification = result.grade_classification || undefined
|
|
// 授权部门
|
|
formInline.authDept = result.auth_dept
|
|
// 标准体系
|
|
formInline.standardSystem = result.standard_system ? result.standard_system.split(',').map(item => {
|
|
return { value: item }
|
|
}) : []
|
|
// 标准英文名称
|
|
formInline.standardEnglishName = result.standard_english_name
|
|
// 发布日期
|
|
formInline.releaseDate = result.release_date
|
|
// 实施日期
|
|
formInline.implementationDate = result.implementation_date
|
|
// 是否试行
|
|
formInline.tryFlag = result.try_flag
|
|
// 试行周期
|
|
formInline.trialPeriod = result.trial_period || undefined
|
|
// 零部件分类
|
|
formInline.partName = result.part_name
|
|
formInline.partName_dictText = result.part_name_dictText
|
|
// 主起草人
|
|
formInline.mainDraftingUser = result.main_drafting_user
|
|
formInline.mainDraftingUser_dictText = result.main_drafting_user_dictText
|
|
// 主起草单位
|
|
formInline.mainDraftingUnit = result.main_drafting_unit
|
|
// 代替标准号
|
|
formInline.substituteStandardNumber = result.substitute_standard_number
|
|
// 引用标准
|
|
formInline.referenceStandard = result.reference_standard
|
|
// 关联文件
|
|
formInline.associatedFile = result.associated_file
|
|
// 采标程度
|
|
formInline.acquisitionDegree = result.acquisition_degree || null
|
|
// 采用国际标准号
|
|
formInline.internationalStandardNum = result.international_standard_num
|
|
this.formInline = Object.assign({}, formInline)
|
|
this.$refs.ruleForm.clearValidate()
|
|
this.$emit('listChange', [this.formInline])
|
|
}
|
|
}).finally(() => {
|
|
this.loading = false
|
|
setTimeout(() => {
|
|
this.isEditSetData = false
|
|
}, 500)
|
|
})
|
|
},
|
|
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
|
|
initData (data) {
|
|
this.isEditSetData = true
|
|
const formInline = Object.assign({}, data)
|
|
formInline.standardSystem = formInline.standardSystem ? formInline.standardSystem.split(',').map(item => {
|
|
return { value: item }
|
|
}) : []
|
|
formInline.gradeClassification = formInline.gradeClassification || undefined
|
|
this.formInline = Object.assign({}, formInline)
|
|
setTimeout(() => {
|
|
this.isEditSetData = false
|
|
}, 500)
|
|
},
|
|
// 外层要获取数据
|
|
getData () {
|
|
const formInline = Object.assign({}, this.formInline)
|
|
if (formInline.standardSystem && formInline.standardSystem.length > 0) {
|
|
formInline.standardSystem = formInline.standardSystem.map(item => item.value).join(',')
|
|
} else {
|
|
formInline.standardSystem = ''
|
|
}
|
|
return formInline
|
|
},
|
|
// 外层获取数据要过校验,返回false表示没有通过校验
|
|
async getDataValidate () {
|
|
let formInline = {}
|
|
await this.$refs.ruleForm.validate(valid => {
|
|
if (valid) {
|
|
formInline = Object.assign({}, this.formInline)
|
|
if (formInline.standardSystem && formInline.standardSystem.length > 0) {
|
|
formInline.standardSystem = formInline.standardSystem.map(item => item.value).join(',')
|
|
} else {
|
|
formInline.standardSystem = ''
|
|
}
|
|
} else {
|
|
formInline = false
|
|
}
|
|
})
|
|
return formInline
|
|
},
|
|
// 获取企标级别映射列表数据
|
|
initStandardGradeClassification () {
|
|
getStandardGradeClassification().then(res => {
|
|
if (res.success) {
|
|
this.standardGradeClassification = res.result
|
|
}
|
|
})
|
|
},
|
|
// 获取标准体系下拉框数据
|
|
initStandardSystemOptions () {
|
|
getTreeList({ option: 1 }).then(res => {
|
|
if (res.success) {
|
|
this.standardSystemOptions = res.result
|
|
}
|
|
})
|
|
},
|
|
// 选完企标编号了,需要回显内容
|
|
listChange (value) {
|
|
if (!value[0] || this.formInline.standardId === value[0].id) {
|
|
// 说明标准没有换,不更新数据
|
|
return
|
|
}
|
|
this.loading = true
|
|
this.isEditSetData = true
|
|
this.$emit('listChange', value)
|
|
// 企标名称
|
|
this.formInline.standardName = value[0].standardName
|
|
// 根据返回的id查询企标数据
|
|
getEnterpriseStandardInfoById({ id: value[0].id, type: '2' }).then(res => {
|
|
if (res.success) {
|
|
const result = res.result
|
|
const formInline = {}
|
|
// 企标id
|
|
formInline.standardId = result.id
|
|
// 标准等级分类
|
|
formInline.gradeClassification = result.grade_classification || undefined
|
|
// 授权部门
|
|
formInline.authDept = result.auth_dept
|
|
// 标准体系
|
|
formInline.standardSystem = result.standard_system ? result.standard_system.split(',').map(item => {
|
|
return { value: item }
|
|
}) : []
|
|
// 标准英文名称
|
|
formInline.standardEnglishName = result.standard_english_name
|
|
// 发布日期
|
|
formInline.releaseDate = result.release_date
|
|
// 实施日期
|
|
formInline.implementationDate = result.implementation_date
|
|
// 是否试行
|
|
formInline.tryFlag = result.try_flag
|
|
// 试行周期
|
|
formInline.trialPeriod = result.trial_period || undefined
|
|
// 零部件分类
|
|
formInline.partName = result.part_name
|
|
formInline.partName_dictText = result.part_name_dictText
|
|
// 主起草人
|
|
formInline.mainDraftingUser = result.main_drafting_user
|
|
formInline.mainDraftingUser_dictText = result.main_drafting_user_dictText
|
|
// 主起草单位
|
|
formInline.mainDraftingUnit = result.main_drafting_unit
|
|
// 代替标准号
|
|
formInline.substituteStandardNumber = result.substitute_standard_number
|
|
// 引用标准
|
|
formInline.referenceStandard = result.reference_standard
|
|
// 关联文件
|
|
formInline.associatedFile = result.associated_file
|
|
// 采标程度
|
|
formInline.acquisitionDegree = result.acquisition_degree || null
|
|
// 采用国际标准号
|
|
formInline.internationalStandardNum = result.international_standard_num
|
|
this.formInline = Object.assign({}, this.formInline, formInline)
|
|
this.$refs.ruleForm.clearValidate()
|
|
}
|
|
}).finally(() => {
|
|
this.loading = false
|
|
setTimeout(() => {
|
|
this.isEditSetData = false
|
|
}, 500)
|
|
})
|
|
},
|
|
// 零部件分类选择完成的回调
|
|
treeSelectNameChange (value, fieldName) {
|
|
this.formInline[fieldName + '_dictText'] = value
|
|
},
|
|
// 选择用户得到用户名
|
|
userSelectNameChange (value, fieldName) {
|
|
this.formInline[fieldName + '_dictText'] = value
|
|
},
|
|
// 点击文件上传
|
|
clickButtonToUpload (fieldName) {
|
|
this.$refs.uploadFile.open(this.formInline[fieldName])
|
|
this.uploadName = fieldName
|
|
},
|
|
// 文件上传改变后的回调
|
|
uploadFileChange (data) {
|
|
const attIdList = []
|
|
if (data && data.length > 0) {
|
|
data.map(item => {
|
|
attIdList.push(item.id)
|
|
})
|
|
}
|
|
/** 赋值给当前对应的表单文件 */
|
|
this.formInline[this.uploadName] = attIdList.join(',')
|
|
this.formInline = { ...this.formInline }
|
|
},
|
|
// 在线编辑需要的参数
|
|
getOnlineEditorParams () {
|
|
return {
|
|
standard_number: this.formInline.standardNumber, //标准编号,
|
|
substitute_standard_number: this.formInline.substituteStandardNumber, // 代替标准号
|
|
implementation_date: this.formInline.implementationDate, // 实施日期
|
|
release_date: this.formInline.releaseDate, // 发布日期
|
|
standard_name: this.formInline.standardName, // 标准名称
|
|
standard_english_name: this.formInline.standardEnglishName // 标准英文名称
|
|
}
|
|
},
|
|
/**
|
|
* 校验部分字段
|
|
* @param fields
|
|
*/
|
|
validateFormByFields (fields) {
|
|
const resultList = []
|
|
this.$refs.ruleForm.validateField(fields, (error) => {
|
|
resultList.push(error)
|
|
})
|
|
if (resultList.every(tt => !tt)) {
|
|
return true
|
|
}
|
|
return false
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped lang="less">
|
|
@import '~@assets/less/common.less';
|
|
/deep/ .ant-form-item-children > * {
|
|
width: 100% !important;
|
|
}
|
|
</style>
|