From 35512dbb0d3db8771e115274355149831b0708b8 Mon Sep 17 00:00:00 2001
From: lideqin <694785430@qq.com>
Date: Fri, 2 Aug 2024 09:38:37 +0800
Subject: [PATCH] =?UTF-8?q?[update]=20=E4=BF=AE=E6=94=B9bug87995?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/customField/AddForm.vue | 22 +++++++++
.../selection/StandardSelectionModal.vue | 49 +++++++++++++++----
.../modules/EnterpriseStandardModal.vue | 1 +
.../modules/ForeignStandardModal.vue | 1 +
4 files changed, 63 insertions(+), 10 deletions(-)
diff --git a/src/components/customField/AddForm.vue b/src/components/customField/AddForm.vue
index 5548de9..69bde66 100644
--- a/src/components/customField/AddForm.vue
+++ b/src/components/customField/AddForm.vue
@@ -57,6 +57,7 @@
:disabledSourceSearch="!selectStandardCanUpdateTypeField.includes(item.dbFieldName)"
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)"
:exclude-standard-numbers="excludeStandardFields.includes(item.dbFieldName) ? excludeStandardNumbers : null"
+ :is-value-have-name="selectStandardValueNeedNameField.includes(item.dbFieldName)"
v-model="formInline[item.dbFieldName]" />
+
+
+
+
+
+
+
+
@@ -173,10 +182,12 @@ import TreeSelection from '../selection/TreeSelection'
import STreeSelect from '../STreeSelect'
import { isHasPermission } from '../../utils/hasPermission'
import { mapGetters } from 'vuex'
+import TreeDataSelection from '../selection/TreeDataSelection'
export default {
name: 'AddForm',
components: {
+ TreeDataSelection,
UserSelection,
JMultipleDatePicker,
StandardSelection,
@@ -295,6 +306,14 @@ export default {
default: () => {
return []
}
+ },
+ // 选标准字段需要在value里面加标准名称的字段
+ selectStandardValueNeedNameField: {
+ type: Array,
+ required: false,
+ default: () => {
+ return []
+ }
}
},
data () {
@@ -577,6 +596,9 @@ export default {
treeSelectNameChange (value, fieldName) {
this.formInline[fieldName + '_dictText'] = value
},
+ treeDataSelectNameChange (value, fieldName) {
+ this.formInline[fieldName + '_dictText'] = value
+ },
submit () {
this.$refs.ruleForm.validate(valid => {
if (valid) {
diff --git a/src/components/selection/StandardSelectionModal.vue b/src/components/selection/StandardSelectionModal.vue
index a9d299a..df4f05e 100644
--- a/src/components/selection/StandardSelectionModal.vue
+++ b/src/components/selection/StandardSelectionModal.vue
@@ -56,7 +56,7 @@
this.selectedRowList.length) {
// 说明是增加了数据
- for (const rowIndex in selectedRows) {
- if (!this.selectedRowList.find(item => (item.standardNumber + '|' + item.standardName) === (selectedRows[rowIndex].standardNumber + '|' + selectedRows[rowIndex].standardName))) {
- // 不存在,追加
- this.selectedRowList.push(selectedRows[rowIndex])
+ if (this.isValueHaveName) {
+ // value里面要带标准名称
+ for (const rowIndex in selectedRows) {
+ if (!this.selectedRowList.find(item => (item.standardNumber + '|' + item.standardName) === (selectedRows[rowIndex].standardNumber + '|' + selectedRows[rowIndex].standardName))) {
+ // 不存在,追加
+ this.selectedRowList.push(selectedRows[rowIndex])
+ }
+ }
+ } else {
+ // value不带标准名称
+ for (const rowIndex in selectedRows) {
+ if (!this.selectedRowList.find(item => item.standardNumber === selectedRows[rowIndex].standardNumber)) {
+ // 不存在,追加
+ this.selectedRowList.push(selectedRows[rowIndex])
+ }
}
}
} else {
// 说明是删除了数据
if (selectedRowKeys && selectedRowKeys.length > 0) {
// 没有选中数据,说明这一页没有选中数据了
- for (let i = 0; i < this.selectedRowList.length; i++) {
- if (!selectedRowKeys.find(item => item === this.selectedRowList[i].standardNumber + '|' + this.selectedRowList[i].standardName)) {
- // 表格选中中没有找到这一条数据,说明已经被删了
- this.selectedRowList.splice(i, 1)
- i--
+ if (this.isValueHaveName) {
+ // value里面要带标准名称
+ for (let i = 0; i < this.selectedRowList.length; i++) {
+ if (!selectedRowKeys.find(item => item === this.selectedRowList[i].standardNumber + '|' + this.selectedRowList[i].standardName)) {
+ // 表格选中中没有找到这一条数据,说明已经被删了
+ this.selectedRowList.splice(i, 1)
+ i--
+ }
+ }
+ } else {
+ for (let i = 0; i < this.selectedRowList.length; i++) {
+ if (!selectedRowKeys.find(item => item === this.selectedRowList[i].standardNumber)) {
+ // 表格选中中没有找到这一条数据,说明已经被删了
+ this.selectedRowList.splice(i, 1)
+ i--
+ }
}
}
+
} else {
this.selectedRowList = []
}
diff --git a/src/views/enterpriseStandardLibrary/standard/modules/EnterpriseStandardModal.vue b/src/views/enterpriseStandardLibrary/standard/modules/EnterpriseStandardModal.vue
index a52c990..02b33f0 100644
--- a/src/views/enterpriseStandardLibrary/standard/modules/EnterpriseStandardModal.vue
+++ b/src/views/enterpriseStandardLibrary/standard/modules/EnterpriseStandardModal.vue
@@ -23,6 +23,7 @@
:get-form-func="getFormFunc"
:get-document-info-func="getDocumentInfoFunc"
:exclude-standard-fields="['substitute_standard_number', 'reference_standard']"
+ :selectStandardValueNeedNameField="['substitute_standard_number', 'reference_standard']"
@submitFormData="submitFormData" />