[update] 修改bug87995
This commit is contained in:
@@ -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]" />
|
||||
<!-- 7, 多选组织机构 -->
|
||||
<j-select-depart v-else-if="item.fieldShowType === FieldType.ORGAN_MORE.value"
|
||||
@@ -142,6 +143,14 @@
|
||||
:nameStr="formInline[item.dbFieldName + '_dictText']"
|
||||
:dict-id="item.dictId"
|
||||
:disabled="disabled || disabledFieldList.includes(item.dbFieldName)" />
|
||||
<!-- <tree-data-selection v-else-if="item.fieldShowType === FieldType.TREE_MODAL_SELECT.value || item.fieldShowType === FieldType.TREE_MODAL_SELECT_SEARCH_DIFF.value"-->
|
||||
<!-- :placeholder="$t('pleaseSelect')+item.dbFieldTxt"-->
|
||||
<!-- v-model="formInline[item.dbFieldName]"-->
|
||||
<!-- :fieldName="item.dbFieldName"-->
|
||||
<!-- :nameStr="formInline[item.dbFieldName + '_dictText']"-->
|
||||
<!-- @nameChange="treeDataSelectNameChange"-->
|
||||
<!-- :optionsHref="item.fieldHref"-->
|
||||
<!-- :dict-id="item.dictId"/>-->
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</template>
|
||||
@@ -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) {
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
</div>
|
||||
<a-table
|
||||
:columns="columns"
|
||||
:rowKey="record => {return record.standardNumber + '|' + record.standardName}"
|
||||
:rowKey="record => {return isValueHaveName ? record.standardNumber + '|' + record.standardName : record.standardNumber}"
|
||||
:scroll="{x: 900}"
|
||||
:data-source="dataList"
|
||||
:pagination="ipagination"
|
||||
@@ -152,6 +152,12 @@ export default {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
},
|
||||
// 是否value要有标准名称
|
||||
isValueHaveName: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data () {
|
||||
@@ -330,23 +336,46 @@ export default {
|
||||
if (this.type === 'checkbox') {
|
||||
if (selectedRowKeys.length > 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 = []
|
||||
}
|
||||
|
||||
@@ -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" />
|
||||
<div class="header-text-btn">
|
||||
<!-- 稽查内容 -->
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
:open-selected-all-field-list="openSelectedAllFieldList"
|
||||
:exclude-standard-fields="excludeStandardFields"
|
||||
:flag-by-field="{associated_enterprise_standard: StandardSource.ENTERPRISE.value, associated_standard: StandardSource.FOREIGN.value}"
|
||||
:selectStandardValueNeedNameField="['substitute_standard_number', 'reference_standard']"
|
||||
@submitFormData="submitFormData" />
|
||||
</a-spin>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user