[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
+50 -4
View File
@@ -91,7 +91,7 @@
:type="'select'"
:triggerChange="false"
:options="optionsData[item.dbFieldName]"
:dictCode="item.fieldHref ? null : item.dictField" />
:dictCode="item.fieldHref || dictNotCodes.includes(item.dbFieldName) ? null : item.dictField" />
<!-- 11, 下拉多选数据字典 -->
<j-multi-select-tag v-else-if="item.fieldShowType === FieldType.OPTION_MORE.value"
class="box-input"
@@ -164,12 +164,12 @@ import {
IsTrial,
EnterpriseStandardStatus,
StandardSource,
StandardStatus
StandardStatus, EnterpriseStandardCode, EnterpriseNameCode
} from '../../enums/commonEnums'
import JMultipleDatePicker from '../JMultipleDatePicker'
import UserSelection from '../selection/UserSelection'
import { getAction } from '../../api/manage.js'
import { getFormDictTreeList } from '../../api/api.js'
import { ajaxGetDictItems, getDictByCode, getFormDictTreeList } from '../../api/api.js'
import TreeSelection from '../selection/TreeSelection'
import { getStandardGradeClassification } from '../../api/enterpriseStandardLibraryApi'
import STreeSelect from '../STreeSelect'
@@ -332,7 +332,8 @@ export default {
innerDisabledField: [], // 内部不可编辑字段
departSelectRange: [], // 选择部门的选择范围,传了就只能从这些里面选,不传就都能选
isEditSetData: false, // 正在编辑回显数据
oldMainDraftingUnit: '' // 上一次的主起草单位
oldMainDraftingUnit: '', // 上一次的主起草单位
dictNotCodes: ['name_code'] // 用到字典的字段不传dictCode的字段
}
},
watch: {
@@ -500,6 +501,34 @@ export default {
}
// 起草、征求依据、报批、废止状态时发布日期、实施日期不必填
this.handleRequiredByState(val)
},
// 企标:企业标准代号选Q,企业名称代号只能选ZZ\ZR;标准代号选TS,企业名称代号只能选ZZ
'formInline.standard_code' (val) {
if (this.flag === StandardSource.ENTERPRISE.value && !this.isEditSetData) {
if (val === EnterpriseStandardCode.Q.value) {
// 选的Q,企业名称代号只能选ZZ\ZR
this.optionsData.name_code.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.optionsData.name_code.map(item => {
if (![EnterpriseNameCode.ZZ.value].includes(item.value)) {
item.disabled = true
} else {
item.disabled = false
}
})
}
if (this.formInline.name_code !== EnterpriseNameCode.ZZ.value) {
this.formInline.name_code = undefined
this.formInline = Object.assign({}, this.formInline)
}
}
}
},
methods: {
@@ -646,6 +675,23 @@ export default {
this.$set(this.optionsData, item.dbFieldName, res.result)
}
})
} else if (item.fieldShowType === FieldType.OPTION_SINGLE.value && this.dictNotCodes.includes(item.dbFieldName)) {
ajaxGetDictItems(item.dictField).then(res => {
if (res.success) {
const result = JSON.parse(JSON.stringify(res.result))
if (item.dbFieldName === 'name_code') {
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
}
}
}
console.log('获取企业名称代号下拉框数据成功了', result)
this.$set(this.optionsData, item.dbFieldName, result)
}
})
}
})
},
+1 -1
View File
@@ -23,7 +23,7 @@
@change="handleInput"
>
<a-select-option :value="undefined">请选择</a-select-option>
<a-select-option v-for="(item, key) in dictOptions" :key="key" :value="item.value">
<a-select-option v-for="(item, key) in dictOptions" :key="key" :value="item.value" :disabled="item.disabled || false">
<span style="display: inline-block;width: 100%" :title=" item.text || item.label ">
{{ item.text || item.label }}
</span>
+15
View File
@@ -582,3 +582,18 @@ export const ReadFlag = {
UNREAD: { text: '未读', value: '0' },
READ: { text: '已读', value: '1' }
}
// 企业标准代号
export const EnterpriseStandardCode = {
Q: { text: 'Q', value: 'Q' },
TS: { text: 'TS', value: 'TS' }
}
// 企业名称代号
export const EnterpriseNameCode = {
ZZ: { text: 'ZZ', value: 'ZZ' },
ZR: { text: 'ZR', value: 'ZR' },
WQ: { text: 'WQ', value: 'WQ' },
JC: { text: 'JC', value: 'JC' },
JHK: { text: 'JHK', value: 'JHK' }
}
@@ -118,7 +118,7 @@
:type="'select'"
:triggerChange="false"
:disabled="disabled"
dictCode="enterprise_name_code" />
:options="enNameCodeOption" />
</a-form-model-item>
</div>
<!-- 标准类别代号 -->
@@ -529,8 +529,14 @@
</template>
<script>
import { StandardSource, ProjectType, ApplicationCategory, StandardGradeClassify } from '@/enums/commonEnums'
import { getWorkGroupTreeList } from '@/api/api'
import {
StandardSource,
ProjectType,
ApplicationCategory,
StandardGradeClassify,
EnterpriseNameCode,
EnterpriseStandardCode } from '@/enums/commonEnums'
import { getWorkGroupTreeList, ajaxGetDictItems } from '@/api/api'
import UserSelection from '@/components/selection/UserSelection'
import StandardSelection from '@/components/selection/StandardSelection'
import UploadFile from '@/components/UploadFile'
@@ -722,7 +728,8 @@ export default {
authDeptSelectRange: [], // 授权部门可选项
authDeptDisabled: false, // 授权部门不可修改
isEditSetData: false, // 是否正在初始化数据
oldMainDraftingUnit: '' // 上一次的主起草单位
oldMainDraftingUnit: '', // 上一次的主起草单位
enNameCodeOption: [] // 企业名称代号下拉框数据
}
},
computed: {
@@ -810,13 +817,37 @@ export default {
}
this.oldMainDraftingUnit = val
}
}
// // 企业标准代号
// 'formInline.enStandardCode' (value) {
// this.getEnStandardNo()
// },
},
// 企业标准代号
'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)
}
}
},
// // 企业名称代号
// 'formInline.enNameCode' (value) {
// 'formInline.enNameCode' (val) {
// this.getEnStandardNo()
// },
// // 标准类别代号
@@ -827,6 +858,8 @@ export default {
created () {
// 获取企标级别映射数据
this.getStandardGradeClassification()
// 获取企业名称代号下拉框数据
this.getEnNameCodeOption()
},
mounted () {
this.getWorkGroupTree()
@@ -948,6 +981,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
}
})
},
// 获取内部工作组树
getWorkGroupTree () {
getWorkGroupTreeList().then((res) => {
@@ -118,7 +118,7 @@
:type="'select'"
:triggerChange="false"
:disabled="disabled"
dictCode="enterprise_name_code" />
:options="enNameCodeOption" />
</a-form-model-item>
</div>
<!-- 标准类别代号 -->
@@ -506,15 +506,21 @@
</template>
<script>
import { StandardSource, ProjectType, ApplicationCategory, StandardGradeClassify } from '@/enums/commonEnums'
import {
StandardSource,
ProjectType,
ApplicationCategory,
StandardGradeClassify,
EnterpriseNameCode,
EnterpriseStandardCode } from '@/enums/commonEnums'
import UserSelection from '@/components/selection/UserSelection'
import StandardSelection from '@/components/selection/StandardSelection'
import UploadFile from '@/components/UploadFile'
import { getTreeList, getStandardGradeClassification } from '@/api/enterpriseStandardLibraryApi'
import Vue from 'vue'
import { USER_INFO } from '@/store/mutation-types'
import { getEnStandardNo } from '@/api/workCenter'
import TreeSelection from '@/components/selection/TreeSelection'
import { ajaxGetDictItems } from '@/api/api'
export default {
name: 'BaseInfoTableModal',
@@ -730,7 +736,8 @@ export default {
isEditSetData: false, // 是否正在初始化数据
authDeptDisabled: false, // 授权部门是否可以更改
authDeptSelectRange: [], // 授权部门可选范围
oldMainDraftingUnit: '' // 上一次的主起草单位
oldMainDraftingUnit: '', // 上一次的主起草单位
enNameCodeOption: [] // 企业名称代号下拉框数据
}
},
computed: {
@@ -818,11 +825,35 @@ export default {
}
this.oldMainDraftingUnit = val
}
}
// // 企业标准代号
// 'formInline.enStandardCode' (value) {
// this.getEnStandardNo()
// },
},
// 企业标准代号
'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)
}
}
},
// // 企业名称代号
// 'formInline.enNameCode' (value) {
// this.getEnStandardNo()
@@ -835,6 +866,8 @@ export default {
created () {
// 获取企标级别映射数据
this.getStandardGradeClassification()
// 获取企业名称代号下拉框数据
this.getEnNameCodeOption()
},
mounted () {
this.initStandardSystemOptions()
@@ -972,6 +1005,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
}
})
},
// watch监视年代号会滞后
// decadeCodeChange (value) {
// this.getEnStandardNo()
@@ -630,7 +630,7 @@ export default {
this.$nextTick(() => {
this.$refs.approvalBaseInfo.isEditSetData = true
const param = this.model.dataList[0]
param.enStandardSystem = param.enStandardSystem ? param.enStandardSystem.split(',').map(item => { return { value: item } }) : []
param.enStandardSystem = param.enStandardSystem && param.enStandardSystem.length > 0 ? param.enStandardSystem.split(',').map(item => { return { value: item } }) : []
// 处理隶属工作组格式
if (param.workGroup) {
param.workGroup = { value: param.workGroup, label: param.workGroup_dictText }
@@ -664,11 +664,15 @@ export default {
// 是责任部门变更或合并变更
this.$nextTick(() => {
this.$nextTick(() => {
this.$refs.changeBaseInfo.isEditSetData = true
const param = this.model.dataList[0]
if (param.enStandardSystem) {
if (param.enStandardSystem && param.enStandardSystem.length > 0) {
param.enStandardSystem = param.enStandardSystem.split(',').map(item => { return { value: item } })
}
this.$refs.changeBaseInfo.formInline = param
setTimeout(() => {
this.$refs.changeBaseInfo.isEditSetData = false
}, 500)
})
// 回显部分节点选人
this.userFormModel = {
@@ -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 () {
// 正在初始化数据,不获取新企标编号
@@ -205,7 +205,7 @@
:type="'select'"
:triggerChange="false"
:disabled="disabled"
dictCode="enterprise_name_code" />
:options="enNameCodeOption" />
</a-form-model-item>
</div>
<!-- 标准类别代号 -->
@@ -437,8 +437,11 @@ import EnterprisePlanSelection from '@/components/selection/EnterprisePlanSelect
import UserSelection from '@/components/selection/UserSelection'
import UploadFile from '@/components/UploadFile'
import { getTreeList } from '@/api/enterpriseStandardLibraryApi'
import { ProjectType } from '@/enums/commonEnums'
import { getFormDictTreeList } from '@/api/api'
import {
ProjectType,
EnterpriseNameCode,
EnterpriseStandardCode } from '@/enums/commonEnums'
import { getFormDictTreeList, ajaxGetDictItems } from '@/api/api'
import TreeSelection from '@/components/selection/TreeSelection'
import { getEnStandardNo } from '@/api/workCenter'
@@ -473,7 +476,32 @@ export default {
this.returnProcessName()
},
// 企业标准代号
'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()
},
// 企业名称代号
@@ -633,7 +661,9 @@ export default {
trigger: 'blur'
}
]
}
},
isEditSetData: false, // 是否正在初始化数据
enNameCodeOption: [] // 企业名称代号下拉框数据
}
},
mounted () {
@@ -641,6 +671,8 @@ export default {
this.initStandardSystemOptions()
// 获取零部件分类下拉框数据
this.initPartNameOptions()
// 获取企业名称代号下拉框数据
this.getEnNameCodeOption()
},
methods: {
// 返回流程名称
@@ -665,6 +697,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
}
})
},
// 零部件分类选择完成的回调
treeSelectNameChange (value, fieldName) {
this.formInline[fieldName + '_dictText'] = value