diff --git a/src/api/standardRegulationLibraryApi.js b/src/api/standardRegulationLibraryApi.js index 8e2863ed..0d973742 100644 --- a/src/api/standardRegulationLibraryApi.js +++ b/src/api/standardRegulationLibraryApi.js @@ -21,9 +21,9 @@ const editDomesticSystemTree = (params) => postAction('/laws/standard/lawsTreeNo // 国内标准-体系删除 const deleteDomesticSystemTree = (params) => postAction('/laws/standard/lawsTreeNode/domestic/delete', params) // 国内标准-配置标准 -const configDomesticStandard = (params) => postAction('', params) +const configDomesticStandard = (params) => getAction('/laws/standard/domestic/relatedStandard', params) // 国内标准-移出标准 -const removeDomesticStandard = (params) => postAction('', params) +const removeDomesticStandard = (params) => getAction('/laws/standard/domestic/removeStandard', params) // 国内标准-获取体系树 const getDomesticStandardTree = (params) => getAction('/laws/standard/lawsTreeNode/domestic', params) // 国内标准-新增标准 diff --git a/src/common/lang/projectLibrary/en.js b/src/common/lang/projectLibrary/en.js index ac4b2f21..ac83e644 100644 --- a/src/common/lang/projectLibrary/en.js +++ b/src/common/lang/projectLibrary/en.js @@ -2,6 +2,7 @@ module.exports = { projectName: 'Project name', // 项目名称 workOrderNumber: 'Work order number', // 工作令编号 projectHealthStatus: 'Project health', // 项目健康度 + selectProject: 'Select Project', // 选择项目 // 车型项目库 vehicleItemLibrary: { diff --git a/src/common/lang/projectLibrary/zh.js b/src/common/lang/projectLibrary/zh.js index cbe18b6f..4fe2edb0 100644 --- a/src/common/lang/projectLibrary/zh.js +++ b/src/common/lang/projectLibrary/zh.js @@ -2,6 +2,7 @@ module.exports = { projectName: '项目名称', workOrderNumber: '工作令编号', projectHealthStatus: '项目健康度', + selectProject: '选择项目', // 车型项目库 vehicleItemLibrary: { diff --git a/src/components/customField/AddForm.vue b/src/components/customField/AddForm.vue index 86cb0356..71be94b7 100644 --- a/src/components/customField/AddForm.vue +++ b/src/components/customField/AddForm.vue @@ -18,7 +18,7 @@ format="YYYY-MM-DD" value-format="YYYY-MM-DD" v-model="formInline[item.dbFieldName]" - :disabled="disabled" + :disabled="disabled || disabledFieldList.includes(item.dbFieldName)" style="width: 100%" /> @@ -37,12 +37,12 @@ @nameChange="userSelectNameChange" :nameStr="formInline[item.dbFieldName + '_name']" type="radio" - :disabled="disabled" /> + :disabled="disabled || disabledFieldList.includes(item.dbFieldName)" /> - + @@ -62,7 +62,7 @@ - + @@ -75,7 +75,7 @@ + :disabled="disabled || disabledFieldList.includes(item.dbFieldName)" /> @@ -89,7 +89,7 @@ @@ -104,7 +104,7 @@ @@ -129,7 +129,7 @@ - + @@ -162,7 +162,7 @@ @@ -178,7 +178,7 @@ @@ -194,7 +194,7 @@ @@ -291,6 +291,22 @@ export default { default: () => { return {} } + }, + // 默认值 + defaultValue: { + type: Object, + required: false, + default: () => { + return {} + } + }, + // 不可修改值 + disabledFieldList: { + type: Array, + required: false, + default: () => { + return [] + } } }, data () { @@ -310,7 +326,7 @@ export default { }, methods: { add () { - this.formInline = {} + this.formInline = Object.assign({}, this.defaultValue) this.type = 'add' this.getForm() }, @@ -402,7 +418,7 @@ export default { this.$set(this.optionsData, item.dbFieldName, res.result) } }) - }else if (item.fieldShowType === FieldType.TREE.value && item.dictId) { + } else if (item.fieldShowType === FieldType.TREE.value && item.dictId) { getFormDictTreeList({ dictId: item.dictId }).then(res => { if (res.success) { this.$set(this.optionsData, item.dbFieldName, res.result) diff --git a/src/views/standardRegulationLibrary/domesticStandard/DomesticStandardList.vue b/src/views/standardRegulationLibrary/domesticStandard/DomesticStandardList.vue index 35fe2fbe..1a6f0801 100644 --- a/src/views/standardRegulationLibrary/domesticStandard/DomesticStandardList.vue +++ b/src/views/standardRegulationLibrary/domesticStandard/DomesticStandardList.vue @@ -251,7 +251,8 @@ export default { yesValue: YesOrNoEnum.YES.value, noValue: YesOrNoEnum.NO.value, nowShareInfo: {}, // 当前正在分享的数据 - selectedTreeKeys: [], // 选中的树节点 + selectedTreeKeys: [], // 选中的树节点key + selectedTreeNodeCodes: [], // 选中树节点的code tableSlotField: ['standard_name', 'standard_number'], // 表格中需要插槽的字段 treeLoading: false } @@ -273,6 +274,7 @@ export default { getDomesticStandardTree({ nodeName: this.treeInput }).then(res => { this.treeData = [] this.selectedTreeKeys = [] + this.selectedTreeNodeCodes = [] this.filters.nodeCode = null if (res.success) { const treeData = res.result || [] @@ -440,6 +442,7 @@ export default { */ handleSelectTreeNode ({ dataRef }) { this.selectedTreeKeys = [dataRef.key] + this.selectedTreeNodeCodes = [dataRef.nodeCode] this.filters.nodeCode = dataRef.nodeCode this.loadData(1) }, @@ -448,7 +451,7 @@ export default { */ handleConfigStandard () { // 没选择左侧树节点,需要提示“请先选择二级及以下体系” - if (!this.selectedTreeKeys || this.selectedTreeKeys.length === 0) { + if (!this.selectedTreeNodeCodes || this.selectedTreeNodeCodes.length === 0) { this.$message.warn(this.$t('standardRegulationLibrary.configStandardNoTreeNode')) return } @@ -462,7 +465,7 @@ export default { continueConfigStandard (dbFieldName, standardIds) { this.loading = true const params = { - nodeId: this.selectedTreeKeys[0], + nodeCode: this.selectedTreeNodeCodes[0], standardIds } configDomesticStandard(params).then(res => { @@ -481,7 +484,7 @@ export default { */ handleRemoveStandard () { // 没选择左侧树节点,需要提示“请先选择二级及以下体系” - if (!this.selectedTreeKeys || this.selectedTreeKeys.length === 0) { + if (!this.selectedTreeNodeCodes || this.selectedTreeNodeCodes.length === 0) { this.$message.warn(this.$t('standardRegulationLibrary.configStandardNoTreeNode')) return } @@ -492,7 +495,7 @@ export default { } this.loading = true const params = { - nodeId: this.selectedTreeKeys[0], + nodeCode: this.selectedTreeNodeCodes[0], ids: this.selectedRowKeys.join(',') } removeDomesticStandard(params).then(res => { diff --git a/src/views/standardRegulationLibrary/domesticStandard/modules/DomesticStandardModal.vue b/src/views/standardRegulationLibrary/domesticStandard/modules/DomesticStandardModal.vue index afc9a8ca..60455baf 100644 --- a/src/views/standardRegulationLibrary/domesticStandard/modules/DomesticStandardModal.vue +++ b/src/views/standardRegulationLibrary/domesticStandard/modules/DomesticStandardModal.vue @@ -14,9 +14,9 @@ @@ -50,18 +50,39 @@ export default { form: {}, confirmLoading: false, getFormFunc: getDomesticStandardFormModal, - getDocumentInfoFunc: getDomesticStandardDocumentInfo + getDocumentInfoFunc: getDomesticStandardDocumentInfo, + // 特殊的placeholder + specialPlaceholder: { + standard_number: `${this.$t('standardRegulationLibrary.inputExample')}7258` + }, + defaultValue: { + year_number: new Date().getFullYear() + }, + isEdit: null // 是否编辑 + } + }, + computed: { + // 不可编辑的字段 + disabledField () { + console.log(this.isEdit) + if (this.isEdit) { + // 标准编号,被代替标准号,被引用标准号 + return ['standard_number', 'replaced_by_standard_number', 'referenced_standard'] + } + return ['replaced_by_standard_number', 'referenced_standard'] } }, methods: { add () { this.visible = true + this.isEdit = false this.$nextTick(() => { this.$refs.addForm.add() }) }, edit (record) { this.visible = true + this.isEdit = true this.$nextTick(() => { this.$refs.addForm.edit(record) })