Browse Source

收集库值不重复

master
xuhuajiao 2 weeks ago
parent
commit
a037aee11e
  1. 12
      src/api/collect/collect.js
  2. 15
      src/views/components/category/PreviewForm.vue

12
src/api/collect/collect.js

@ -412,6 +412,15 @@ export function FetchMaxItemNoByArchivesNo(params) {
}) })
} }
// 根据门类id和字段名字段值检索是否重复
export function FetchIsRepeatByField(params) {
return request({
url: 'api/collect/isRepeatByField',
method: 'get',
params
})
}
export default { export default {
collectAdd, collectAdd,
collectEdit, collectEdit,
@ -454,5 +463,6 @@ export default {
FetchMaxItemNoByParentId, FetchMaxItemNoByParentId,
FetchIsRepeatByArchivesNo, FetchIsRepeatByArchivesNo,
FetchIsRepeatAllByArchivesNo, FetchIsRepeatAllByArchivesNo,
FetchMaxItemNoByArchivesNo
FetchMaxItemNoByArchivesNo,
FetchIsRepeatByField
} }

15
src/views/components/category/PreviewForm.vue

@ -200,8 +200,7 @@
<script> <script>
import { crud } from '@crud/crud' import { crud } from '@crud/crud'
import { FetchDoeditIsRepeat } from '@/api/archivesManage/archivesList'
import { collectAdd, collectEdit, FetchIsRepeatByArchivesNo, FetchIsRepeatAllByArchivesNo, FetchMaxItemNoByArchivesNo } from '@/api/collect/collect'
import { collectAdd, collectEdit, FetchIsRepeatByArchivesNo, FetchIsRepeatAllByArchivesNo, FetchMaxItemNoByArchivesNo, FetchIsRepeatByField } from '@/api/collect/collect'
import { prearchEdit, FetchMergeToFile, FetchReDoeditIsRepeat } from '@/api/prearchiveLibrary/prearchiveLibrary' import { prearchEdit, FetchMergeToFile, FetchReDoeditIsRepeat } from '@/api/prearchiveLibrary/prearchiveLibrary'
import { getNoFormatField } from '@/api/system/category/fileNoFormat' import { getNoFormatField } from '@/api/system/category/fileNoFormat'
import draggable from 'vuedraggable' import draggable from 'vuedraggable'
@ -1197,7 +1196,7 @@ export default {
// api // api
handlerIsRepeat(params, item) { handlerIsRepeat(params, item) {
if (this.isDesFormType !== 'prearchiveLibrary') { if (this.isDesFormType !== 'prearchiveLibrary') {
FetchDoeditIsRepeat(params).then(res => {
FetchIsRepeatByField(params).then(res => {
if (res) { if (res) {
this.$message({ message: item.fieldCnName + '不可重复', type: 'error', offset: 8 }) this.$message({ message: item.fieldCnName + '不可重复', type: 'error', offset: 8 })
} }
@ -1219,9 +1218,10 @@ export default {
const params = this.isDesFormType !== 'prearchiveLibrary' const params = this.isDesFormType !== 'prearchiveLibrary'
? { ? {
'categoryId': this.selectedCategory.id, 'categoryId': this.selectedCategory.id,
'archivesId': this.arcId,
// 'archivesId': this.arcId,
'categoryLevel': this.collectLevel,
'fieldName': item.fieldName, 'fieldName': item.fieldName,
'value': this.addOrUpdateForm[item.fieldName]
'fieldValue': this.addOrUpdateForm[item.fieldName]
} }
: { : {
'documentId': this.selectedCategory.id, 'documentId': this.selectedCategory.id,
@ -1278,9 +1278,10 @@ export default {
const params = this.isDesFormType !== 'prearchiveLibrary' && this.isDesFormType !== 'mergeFile' const params = this.isDesFormType !== 'prearchiveLibrary' && this.isDesFormType !== 'mergeFile'
? { ? {
'categoryId': this.selectedCategory.id, 'categoryId': this.selectedCategory.id,
'archivesId': this.arcId,
// 'archivesId': this.arcId,
'categoryLevel': this.collectLevel,
'fieldName': this.treeCurrentFiled.fieldName, 'fieldName': this.treeCurrentFiled.fieldName,
'value': val.dictionaryName
'fieldValue': val.dictionaryName
} }
: { : {
'documentId': this.selectedCategory.id, 'documentId': this.selectedCategory.id,

Loading…
Cancel
Save