[update] 企标:企业标准代号选了Q,企业名称代号只能选ZZ\ZR,选了TS,名称代号只能选ZZ

This commit is contained in:
lideqin
2024-03-05 14:41:36 +08:00
parent 765f60a99a
commit b730e79599
8 changed files with 297 additions and 36 deletions
@@ -80,7 +80,7 @@
:placeholder="$t('pleaseSelect')+$t('workCenter.enterpriseInitChangePlan.enterpriseNameCode')"
:type="'select'"
:triggerChange="false"
dictCode="enterprise_name_code" />
:options="enNameCodeOption" />
</a-form-model-item>
</div>
<!-- 标准类别代号 -->
@@ -608,7 +608,13 @@
<script>
import Vue from 'vue'
import { USER_INFO } from '@/store/mutation-types'
import { StandardSource, ProjectType, StandardGradeClassify } from '@/enums/commonEnums.js'
import {
StandardSource,
ProjectType,
StandardGradeClassify,
EnterpriseNameCode,
EnterpriseStandardCode
} from '@/enums/commonEnums.js'
import StandardSelection from '@/components/selection/StandardSelection'
import UserSelection from '@/components/selection/UserSelection'
import UploadFile from '@/components/UploadFile'
@@ -619,7 +625,7 @@ import {
getTreeList,
getStandardGradeClassification
} from '@/api/enterpriseStandardLibraryApi'
import { getWorkGroupTreeList } from '@/api/api'
import { getWorkGroupTreeList, ajaxGetDictItems } from '@/api/api'
export default {
name: 'ApprovalBaseInfo',
@@ -661,7 +667,32 @@ export default {
this.$forceUpdate()
},
// 企业标准代号
'formInline.enStandardCode' (value) {
'formInline.enStandardCode' (val) {
if (!this.isEditSetData) {
if (val === EnterpriseStandardCode.Q.value) {
// 选的Q,企业名称代号只能选ZZ\ZR
this.enNameCodeOption.map(item => {
if (![EnterpriseNameCode.ZZ.value, EnterpriseNameCode.ZR.value].includes(item.value)) {
item.disabled = true
} else {
item.disabled = false
}
})
} else if (val === EnterpriseStandardCode.TS.value) {
// 选的TS,企业名称代号只能选ZZ
this.enNameCodeOption.map(item => {
if (![EnterpriseNameCode.ZZ.value].includes(item.value)) {
item.disabled = true
} else {
item.disabled = false
}
})
}
if (this.formInline.enNameCode !== EnterpriseNameCode.ZZ.value) {
this.formInline.enNameCode = undefined
this.formInline = Object.assign({}, this.formInline)
}
}
this.getEnStandardNo()
},
// 企业名称代号
@@ -946,7 +977,8 @@ export default {
isEditSetData: false, // 是否正在初始化数据
authDeptDisabled: false, // 授权部门不可修改
authDeptSelectRange: [], // 授权部门的可选项
oldMainDraftingUnit: '' // 上一次的主起草单位
oldMainDraftingUnit: '', // 上一次的主起草单位
enNameCodeOption: [] // 企业名称代号下拉框数据
}
},
created () {
@@ -956,6 +988,8 @@ export default {
this.getStandardGradeClassification()
// 获取隶属工作组数据
this.getWorkGroupTree()
// 获取企业名称代号下拉框数据
this.getEnNameCodeOption()
},
mounted () {
console.log(this.$route.query.processId)
@@ -1016,6 +1050,22 @@ export default {
}
})
},
// 获取企业名称代号下拉框数据
getEnNameCodeOption () {
ajaxGetDictItems('enterprise_name_code').then(res => {
if (res.success) {
const result = JSON.parse(JSON.stringify(res.result))
for (const dictItem of result) {
if ([EnterpriseNameCode.WQ.value, EnterpriseNameCode.JC.value, EnterpriseNameCode.JHK.value].includes(dictItem.value)) {
dictItem.disabled = true
} else {
dictItem.disabled = false
}
}
this.enNameCodeOption = result
}
})
},
// 根据三个代号和一个年代号获取企标编号
getEnStandardNo () {
// 正在初始化数据,不获取新企标编号