From 8976bd2b54f9afdeb4166f2e9f9aad15a293a1f8 Mon Sep 17 00:00:00 2001 From: xuhuajiao <13476289682@163.com> Date: Tue, 27 Feb 2024 17:30:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=80=9F=E9=98=85/=E6=94=B6=E9=9B=86=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=BA=93=E7=AD=9B=E9=80=89=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/archiveUtilize/cart.js | 22 ++ src/layout/components/Navbar.vue | 4 +- src/router/routers.js | 6 + .../archiveSearch/module/resultList.vue | 61 ++-- .../module/utilizationProcess.vue | 334 ++++++++++++++++++ .../managementLibrary/index.vue | 71 ++-- .../collectionLibrary/index.vue | 86 +++-- src/views/system/user/cart.vue | 149 ++++++++ 8 files changed, 632 insertions(+), 101 deletions(-) create mode 100644 src/api/archiveUtilize/cart.js create mode 100644 src/views/archiveUtilize/utillizeRecord/module/utilizationProcess.vue create mode 100644 src/views/system/user/cart.vue diff --git a/src/api/archiveUtilize/cart.js b/src/api/archiveUtilize/cart.js new file mode 100644 index 0000000..b86d26b --- /dev/null +++ b/src/api/archiveUtilize/cart.js @@ -0,0 +1,22 @@ +import request from '@/utils/request' +// import qs from 'qs' + +// 添加档案至借阅车 +export function FetchAddBorrowCar(data) { + return request({ + url: 'api/archivesUtilize/addBorrowCar', + method: 'post', + data: data + }) +} + +// 添加借阅流程 +export function FetchInitAddBorrowFlow(data) { + return request({ + url: 'api/archivesUtilize/addBorrowFlow', + ethod: 'post', + data: data + }) +} + +export default { FetchAddBorrowCar, FetchInitAddBorrowFlow } diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index 4ce1194..8da3fe8 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -20,7 +20,9 @@ -
+ +
+
diff --git a/src/router/routers.js b/src/router/routers.js index 71b4cee..4c3dd93 100644 --- a/src/router/routers.js +++ b/src/router/routers.js @@ -55,6 +55,12 @@ export const constantRouterMap = [ component: (resolve) => require(['@/views/system/user/center'], resolve), name: '个人中心', meta: { title: '个人中心' } + }, + { + path: 'cart', + component: (resolve) => require(['@/views/system/user/cart'], resolve), + name: '借阅车', + meta: { title: '借阅车' } } ] }, diff --git a/src/views/archiveUtilize/archiveSearch/module/resultList.vue b/src/views/archiveUtilize/archiveSearch/module/resultList.vue index 5a59a26..874cddf 100644 --- a/src/views/archiveUtilize/archiveSearch/module/resultList.vue +++ b/src/views/archiveUtilize/archiveSearch/module/resultList.vue @@ -123,13 +123,13 @@ 实体 标签 装盒 - 入库 + 入库 借阅
查看详情 - - + +
@@ -149,16 +149,19 @@ + + + diff --git a/src/views/archivesManage/managementLibrary/index.vue b/src/views/archivesManage/managementLibrary/index.vue index f8342b3..26c44ea 100644 --- a/src/views/archivesManage/managementLibrary/index.vue +++ b/src/views/archivesManage/managementLibrary/index.vue @@ -168,7 +168,7 @@ export default { this.yearChildData = data this.classifyLoading = true setTimeout(() => { - if (this.classifyTree[0].dictionaryName === '年度') { + if (this.classifyTree.length !== 0 && this.classifyTree[0].dictionaryName === '年度') { this.classifyTree = this.classifyTree.slice(1) } if (this.yearChildData.length !== 0) { @@ -279,31 +279,37 @@ export default { } this.$nextTick(() => { this.getDictsList() - Promise.all(this.user.roles.map(item => this.getRole(item.id))) - .then(roles => { - const allFondsIds = [] - const fondsObj = {} - roles.forEach(role => { - role.fonds.forEach(fond => { - if (!fondsObj[fond.id]) { - fondsObj[fond.id] = fond - allFondsIds.push(fond.id) - } - }) - }) - this.$refs.classifyTree.setCheckedKeys(allFondsIds) - if (allFondsIds.length !== 0) { - const defaultChecked = this.$refs.classifyTree.getCheckedNodes() - const fondsGroup = defaultChecked.filter(item => item.fondsId).map(item => item.fondsNo) - this.smartQuery.fonds_no = fondsGroup.join(',') - } else { - this.smartQuery.fonds_no = null - } - this.handlePageList() - }) - .catch(error => { - console.error(error) - }) + FetchInitSearchFonds().then(res => { + const allFondsIds = res.map(item => item.fondsId) + this.$refs.classifyTree.setCheckedKeys(allFondsIds) + this.smartQuery.fonds_no = res.map(item => item.fondsNo).join(',') + }) + this.handlePageList() + // Promise.all(this.user.roles.map(item => this.getRole(item.id))) + // .then(roles => { + // const allFondsIds = [] + // const fondsObj = {} + // roles.forEach(role => { + // role.fonds.forEach(fond => { + // if (!fondsObj[fond.id]) { + // fondsObj[fond.id] = fond + // allFondsIds.push(fond.id) + // } + // }) + // }) + // this.$refs.classifyTree.setCheckedKeys(allFondsIds) + // if (allFondsIds.length !== 0) { + // const defaultChecked = this.$refs.classifyTree.getCheckedNodes() + // const fondsGroup = defaultChecked.filter(item => item.fondsId).map(item => item.fondsNo) + // this.smartQuery.fonds_no = fondsGroup.join(',') + // } else { + // this.smartQuery.fonds_no = null + // } + // this.handlePageList() + // }) + // .catch(error => { + // console.error(error) + // }) }) }, handlePageList(isQuickFilter) { @@ -375,7 +381,14 @@ export default { }) fonds = parent } - this.classifyTree = res.dictionarys.concat(fonds) + if (res.dictionarys.length === 0) { + this.classifyTree = [] + if (fonds.length !== 0) { + this.classifyTree.push(fonds) + } + } else { + this.classifyTree = res.dictionarys.concat(fonds) + } this.classifyLoading = false }).catch(err => { console.log(err) @@ -392,7 +405,6 @@ export default { handleCheckChange(data, checked, indeterminate) { // 获取所有选中的节点 const res = this.$refs.classifyTree.getCheckedNodes() - console.log('res', res) // const isFondsTop = res.some(obj => obj.fondsName === '全宗') // if (isFondsTop) { // this.smartQuery.fonds_no = null @@ -400,6 +412,9 @@ export default { if (fondsGroup.length === 0) { FetchInitSearchFonds().then(res => { this.smartQuery.fonds_no = res.map(item => item.fondsNo).join(',') + this.$nextTick(() => { + this.handlePageList('quickFilter') + }) }) } else { this.smartQuery.fonds_no = fondsGroup.join(',') diff --git a/src/views/collectReorganizi/collectionLibrary/index.vue b/src/views/collectReorganizi/collectionLibrary/index.vue index 854db61..5523145 100644 --- a/src/views/collectReorganizi/collectionLibrary/index.vue +++ b/src/views/collectReorganizi/collectionLibrary/index.vue @@ -170,7 +170,7 @@ export default { this.yearChildData = data this.classifyLoading = true setTimeout(() => { - if (this.classifyTree[0].dictionaryName === '年度') { + if (this.classifyTree.length !== 0 && this.classifyTree[0].dictionaryName === '年度') { this.classifyTree = this.classifyTree.slice(1) } if (this.yearChildData.length !== 0) { @@ -280,33 +280,45 @@ export default { } else { this.classifyTree = [] } + this.$nextTick(() => { this.getDictsList() - Promise.all(this.user.roles.map(item => this.getRole(item.id))) - .then(roles => { - const allFondsIds = [] - const fondsObj = {} - roles.forEach(role => { - role.fonds.forEach(fond => { - if (!fondsObj[fond.id]) { - fondsObj[fond.id] = fond - allFondsIds.push(fond.id) - } - }) - }) - this.$refs.classifyTree.setCheckedKeys(allFondsIds) - if (allFondsIds.length !== 0) { - const defaultChecked = this.$refs.classifyTree.getCheckedNodes() - const fondsGroup = defaultChecked.filter(item => item.fondsId).map(item => item.fondsNo) - this.smartQuery.fonds_no = fondsGroup.join(',') - } else { - this.smartQuery.fonds_no = null - } - this.handlePageList() - }) - .catch(error => { - console.error(error) - }) + FetchInitSearchFonds().then(res => { + const allFondsIds = res.map(item => item.fondsId) + this.$refs.classifyTree.setCheckedKeys(allFondsIds) + this.smartQuery.fonds_no = res.map(item => item.fondsNo).join(',') + }) + this.handlePageList() + // Promise.all(this.user.roles.map(item => this.getRole(item.id))) + // .then(roles => { + // const allFondsIds = [] + // const fondsObj = {} + // console.log(roles) + // roles.forEach(role => { + // role.fonds.forEach(fond => { + // if (!fondsObj[fond.id]) { + // fondsObj[fond.id] = fond + // allFondsIds.push(fond.id) + // } + // }) + // }) + // console.log(allFondsIds) + // this.$refs.classifyTree.setCheckedKeys(allFondsIds) + // if (allFondsIds.length !== 0) { + // const defaultChecked = this.$refs.classifyTree.getCheckedNodes() + // const fondsGroup = defaultChecked.filter(item => item.fondsId).map(item => item.fondsNo) + // this.smartQuery.fonds_no = fondsGroup.join(',') + // } else { + // // this.smartQuery.fonds_no = null + // FetchInitSearchFonds().then(res => { + // this.smartQuery.fonds_no = res.map(item => item.fondsNo).join(',') + // }) + // } + // this.handlePageList() + // }) + // .catch(error => { + // console.error(error) + // }) }) }, handlePageList(isQuickFilter) { @@ -378,7 +390,14 @@ export default { }) fonds = parent } - this.classifyTree = res.dictionarys.concat(fonds) + if (res.dictionarys.length === 0) { + this.classifyTree = [] + if (fonds.length !== 0) { + this.classifyTree.push(fonds) + } + } else { + this.classifyTree = res.dictionarys.concat(fonds) + } this.classifyLoading = false }).catch(err => { console.log(err) @@ -402,10 +421,14 @@ export default { if (fondsGroup.length === 0) { FetchInitSearchFonds().then(res => { this.smartQuery.fonds_no = res.map(item => item.fondsNo).join(',') + this.$nextTick(() => { + this.handlePageList('quickFilter') + }) }) } else { this.smartQuery.fonds_no = fondsGroup.join(',') } + // } const groupedData = {} @@ -501,15 +524,6 @@ export default { } else { this.smartQuery.archive_year = null } - // if (res.find(obj => obj.dictionaryCode === 'archive_year')) { - // this.smartQuery.archive_year = null - // } else { - // if (groupedData.archive_year) { - // this.smartQuery.archive_year = groupedData.archive_year.join(',') - // } else { - // this.smartQuery.archive_year = null - // } - // } } } this.$nextTick(() => { diff --git a/src/views/system/user/cart.vue b/src/views/system/user/cart.vue new file mode 100644 index 0000000..dbfb35c --- /dev/null +++ b/src/views/system/user/cart.vue @@ -0,0 +1,149 @@ + + + + +