From bb4e8a9ce74d2f4c61ff7fcd71a6272f10559dc5 Mon Sep 17 00:00:00 2001 From: xuhuajiao <13476289682@163.com> Date: Tue, 2 Aug 2022 11:05:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A1=A3=E6=A1=88=E7=AE=A1=E7=90=86-query?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../archivesList/archivesAnjuan/index.vue | 45 ++++++++++++------- .../archivesList/archivesJuannei/index.vue | 3 ++ .../archivesList/archivesProject/index.vue | 8 ++-- .../archivesList/mixins/archives.js | 10 +---- 4 files changed, 39 insertions(+), 27 deletions(-) diff --git a/src/views/archivesManage/archivesList/archivesAnjuan/index.vue b/src/views/archivesManage/archivesList/archivesAnjuan/index.vue index 6c5f126..d78e04b 100644 --- a/src/views/archivesManage/archivesList/archivesAnjuan/index.vue +++ b/src/views/archivesManage/archivesList/archivesAnjuan/index.vue @@ -235,10 +235,7 @@ export default { return { anjuanData: [], anjuanQuery: {}, - queryOption: [ - { value: 'queryTitle', label: '题名' }, - { value: 'archiveNo', label: '档号' } - ], + queryOption: [], anjuanInputSelect: '', isAnjuan: true, // 用于判断卷内-新增/导出按钮 lengingVisible: false // 借阅 @@ -251,6 +248,11 @@ export default { }, watch: { selectedCategory: function(newValue, oldValue) { + this.query.queryTitle = '' + this.query.archiveNo = '' + this.query.archiveCtgNo = '' + this.query.responsibleby = '' + this.resetQuery() }, tableDisplayFields(val) { this.doLayout() @@ -268,38 +270,51 @@ export default { } }, created() { - // 初始化带select的输入框的 - 搜索 - this.anjuanInputSelect = this.queryOption[0].value + this.resetQuery() this.selections = [] - if (this.selectedCategory.isType === 5) { - this.queryOption.push({ value: 'responsibleby', label: '责任者' }) - } else { - this.queryOption.push({ value: 'archiveCtgNo', label: '实体分类号' }) - } }, mounted() { }, methods: { + // 文件/案卷重置query + resetQuery() { + if (this.selectedCategory.isType === 5) { + this.queryOption = [ + { value: 'queryTitle', label: '题名' }, + { value: 'archiveNo', label: '档号' }, + { value: 'responsibleby', label: '责任者' } + ] + } else { + this.queryOption = [ + { value: 'queryTitle', label: '题名' }, + { value: 'archiveNo', label: '档号' }, + { value: 'archiveCtgNo', label: '实体分类号' } + ] + } + this.anjuanInputSelect = this.queryOption[0].value + }, // 档案列表获取显示列 getTableDisplayFields(type) { this.getTableItemCommon(type) }, // list getTableList(page) { + this.query.queryTitle = '' + this.query.archiveNo = '' + this.query.archiveCtgNo = '' + this.query.responsibleby = '' switch (this.anjuanInputSelect) { case 'queryTitle': // 题名 this.query.queryTitle = this.anjuanQuery[this.anjuanInputSelect] - this.query.archiveNo = '' break case 'archiveNo': // 档号 this.query.archiveNo = this.anjuanQuery[this.anjuanInputSelect] - this.query.queryTitle = '' break case 'archiveCtgNo': // 实体分类号 - this.query.archiveCtgNo = this.anjuanQuery[this.juanneiInputSelect] + this.query.archiveCtgNo = this.anjuanQuery[this.anjuanInputSelect] break case 'responsibleby': // 责任者 - this.query.responsibleby = this.anjuanQuery[this.juanneiInputSelect] + this.query.responsibleby = this.anjuanQuery[this.anjuanInputSelect] break } this.getListCommon('anjuanData', page, 1) diff --git a/src/views/archivesManage/archivesList/archivesJuannei/index.vue b/src/views/archivesManage/archivesList/archivesJuannei/index.vue index 884f3d0..a93c26f 100644 --- a/src/views/archivesManage/archivesList/archivesJuannei/index.vue +++ b/src/views/archivesManage/archivesList/archivesJuannei/index.vue @@ -224,6 +224,9 @@ export default { }, // list getTableList(page) { + this.query.queryTitle = '' + this.query.archiveNo = '' + this.query.responsibleby = '' switch (this.juanneiInputSelect) { case 'queryTitle': // 题名 this.query.queryTitle = this.juanneiQuery[this.juanneiInputSelect] diff --git a/src/views/archivesManage/archivesList/archivesProject/index.vue b/src/views/archivesManage/archivesList/archivesProject/index.vue index dd1aa93..92d7c32 100644 --- a/src/views/archivesManage/archivesList/archivesProject/index.vue +++ b/src/views/archivesManage/archivesList/archivesProject/index.vue @@ -140,7 +140,7 @@ export default { projectQuery: {}, queryOption: [ { value: 'queryTitle', label: '题名' }, - { value: 'recordNo', label: '项目代号' } + { value: 'itemNo', label: '项目代号' } ], projectInputSelect: '', isProject: true // 用于判断案卷-新增/导出按钮 @@ -172,12 +172,14 @@ export default { }, // table - list getTableList(page) { + this.query.queryTitle = '' + this.query.itemNo = '' switch (this.projectInputSelect) { case 'queryTitle': // 题名 this.query.queryTitle = this.projectQuery[this.projectInputSelect] break - case 'record_no': // 项目代号 - 未定 - this.query.recordNo = this.projectQuery[this.projectInputSelect] + case 'itemNo': // 项目代号 - 未定 + this.query.itemNo = this.projectQuery[this.projectInputSelect] break } this.getListCommon('projectData', page, 0) diff --git a/src/views/archivesManage/archivesList/mixins/archives.js b/src/views/archivesManage/archivesList/mixins/archives.js index 3e2f3e5..d7b929c 100644 --- a/src/views/archivesManage/archivesList/mixins/archives.js +++ b/src/views/archivesManage/archivesList/mixins/archives.js @@ -16,14 +16,6 @@ export const archivesCrud = { size: 10, total: 0 }, - query: { - 'queryType': null, - 'queryTitle': null, - 'recordNo': null, - 'archiveCtgNo': null, - 'archiveNo': null, - 'responsibleby': null - }, stateOptions: [ // 搜索 - 状态选择 { key: '1', label: '全部' }, { key: '2', label: '未装' }, @@ -143,7 +135,7 @@ export const archivesCrud = { 'sort': this.arrySort, 'queryType': this.query.queryType, 'queryTitle': this.query.queryTitle, - 'recordNo': this.query.recordNo, + 'itemNo': this.query.itemNo, 'archiveCtgNo': this.query.archiveCtgNo, 'responsibleby': this.query.responsibleby, 'archiveNo': this.query.archiveNo,