10 changed files with 457 additions and 256 deletions
			
			
		- 
					8src/views/archivesManage/archivesList/archivesAnjuan/index.vue
- 
					8src/views/archivesManage/archivesList/archivesJuannei/index.vue
- 
					4src/views/archivesManage/archivesList/mixins/archives.js
- 
					107src/views/archivesManage/archivesSearch/index.vue
- 
					2src/views/archivesManage/caseManage/caseList/index.vue
- 
					1src/views/archivesManage/caseManage/caseList/module/detailDialog.vue
- 
					9src/views/archivesManage/lendManage/toLend/module/lendRecord.vue
- 
					49src/views/system/archiveStatistics/index.vue
- 
					480src/views/system/archiveStatistics/mixins/statistics.js
- 
					45src/views/system/archiveStatistics/module/acrossBar.vue
| @ -1,226 +1,254 @@ | |||
| import { FetchInitBorrowerNumStatistics, FetchInitArchivesTypeNum, FetchInitArchivesTypeStatistics, FetchStorageStatistics, FetchInitArchivesSearchRanking, FetchInitAddArchivesStatistics } from '@/api/archivesManage/statistics' | |||
| // import qs from 'qs'
 | |||
| export const statisticsCrud = { | |||
|   // 组件共用属性
 | |||
|   data() { | |||
|     return { | |||
|       cateDate: '', | |||
|       typeDate: '', | |||
|       inOutStorageDate: '', | |||
|       arcSearchDate: '', | |||
|       arcAddDate: '', | |||
|       pickerOptions: { | |||
|         disabledDate(time) { | |||
|           return time.getTime() > Date.now() - 8.64e6 | |||
|         } | |||
|       }, | |||
|       lendData: [], | |||
|       cateData: [], | |||
|       typeData: [], | |||
|       storageData: { | |||
|         storageMonths: [], | |||
|         inStorageData: [], | |||
|         outStorageData: [] | |||
|       }, | |||
|       searchAcrivesData: { | |||
|         searchName: [], | |||
|         searchValue: [] | |||
|       }, | |||
|       addArcivesData: { | |||
|         addArcivesMonth: [], | |||
|         addArcivesNum: [] | |||
|       } | |||
|     } | |||
|   }, | |||
|   // 组件挂载时的共用方法
 | |||
|   mounted() { | |||
|     this.getBorrowerNumSta() | |||
|     this.getArchivesTypeNum() | |||
|     this.getArchivesTypeStatistics() | |||
|     this.getStorageStatistics() | |||
|     this.getArchivesSearchRanking() | |||
|     this.getAddArchivesStatistics() | |||
|   }, | |||
|   // 组件共用方法
 | |||
|   methods: { | |||
|     // 档案借阅统计
 | |||
|     getBorrowerNumSta() { | |||
|       FetchInitBorrowerNumStatistics().then(res => { | |||
|         if (res) { | |||
|           delete res.total | |||
|           // 固定排序 '在库档案', '已借档案', '待借档案', '逾期档案', '异常档案'
 | |||
|           const borrowerArr = [] | |||
|           for (const i in res) { | |||
|             const obj = {} | |||
|             obj.name = i | |||
|             obj.value = res[i] | |||
|             if (i === 'inStorage') { | |||
|               obj.sequence = 1 | |||
|             } else if (i === 'borrow') { | |||
|               obj.sequence = 2 | |||
|             } else if (i === 'waitBorrow') { | |||
|               obj.sequence = 3 | |||
|             } else if (i === 'overdue') { | |||
|               obj.sequence = 4 | |||
|             } else if (i === 'abnormal') { | |||
|               obj.sequence = 5 | |||
|             } | |||
|             borrowerArr.push(obj) | |||
|           } | |||
|           this.arrSortByKey(borrowerArr, 'sequence', false) | |||
|           borrowerArr.forEach(item => { | |||
|             this.lendData.push(item.value) | |||
|           }) | |||
|         } | |||
|       }) | |||
|     }, | |||
|     // 档案类别 - 年选择
 | |||
|     handleCateDate() { | |||
|       this.cateData = [] | |||
|       this.getArchivesTypeNum() | |||
|     }, | |||
|     // 档案类别
 | |||
|     getArchivesTypeNum() { | |||
|       let params | |||
|       if (this.cateDate) { | |||
|         params = { | |||
|           'year': this.cateDate | |||
|         } | |||
|       } else { | |||
|         params = { | |||
|           'year': null | |||
|         } | |||
|       } | |||
|       FetchInitArchivesTypeNum(params).then(res => { | |||
|         if (res) { | |||
|           for (const i in res) { | |||
|             this.cateData.push(res[i]) | |||
|           } | |||
|         } | |||
|       }) | |||
|     }, | |||
|     // 档案类型 - 月选择
 | |||
|     handleTypeDate() { | |||
|       this.typeData = [] | |||
|       this.getArchivesTypeStatistics() | |||
|     }, | |||
|     // 档案类型
 | |||
|     getArchivesTypeStatistics() { | |||
|       let params | |||
|       if (this.typeDate) { | |||
|         params = { | |||
|           'yearMonth': this.typeDate | |||
|         } | |||
|       } else { | |||
|         params = { | |||
|           'yearMonth': null | |||
|         } | |||
|       } | |||
|       FetchInitArchivesTypeStatistics(params).then(res => { | |||
|         if (res) { | |||
|           res.map(item => { | |||
|             const obj = {} | |||
|             obj.name = item.archivesType | |||
|             obj.value = item.archivesNum | |||
|             this.typeData.push(obj) | |||
|           }) | |||
|         } | |||
|       }) | |||
|     }, | |||
|     // 档案类别 - 年选择
 | |||
|     handleStorageDate() { | |||
|       this.getStorageStatistics() | |||
|     }, | |||
|     // 出入库管理情况
 | |||
|     getStorageStatistics() { | |||
|       let params | |||
|       let getYear | |||
|       if (this.inOutStorageDate) { | |||
|         params = { | |||
|           'year': this.inOutStorageDate | |||
|         } | |||
|         getYear = this.inOutStorageDate | |||
|       } else { | |||
|         params = { | |||
|           'year': null | |||
|         } | |||
|         getYear = new Date().getFullYear() | |||
|       } | |||
|       FetchStorageStatistics(params).then(res => { | |||
|         if (res) { | |||
|           this.storageData.storageMonths = [] | |||
|           res.months.forEach(item => { | |||
|             this.storageData.storageMonths.push(getYear + '/' + item) | |||
|           }) | |||
|           this.storageData.inStorageData = res.inStorage | |||
|           this.storageData.outStorageData = res.outStorage | |||
|         } | |||
|       }) | |||
|     }, | |||
|     handleSearchDate() { | |||
|       this.getArchivesSearchRanking() | |||
|     }, | |||
|     // 档案检索排名
 | |||
|     getArchivesSearchRanking() { | |||
|       let params | |||
|       if (this.arcSearchDate) { | |||
|         params = { | |||
|           'yearMonth': this.arcSearchDate | |||
|         } | |||
|       } else { | |||
|         params = { | |||
|           'yearMonth': null | |||
|         } | |||
|       } | |||
|       FetchInitArchivesSearchRanking(params).then(res => { | |||
|         if (res) { | |||
|           this.arrSortByKey(res, 'num', true) | |||
|           this.searchAcrivesData.searchName = res.map(item => item.cnName) | |||
|           this.searchAcrivesData.searchValue = res.map(item => item.num) | |||
|         } | |||
|       }) | |||
|     }, | |||
|     handleArcAddSta() { | |||
|       this.getAddArchivesStatistics() | |||
|     }, | |||
|     // 档案实际情况
 | |||
|     getAddArchivesStatistics() { | |||
|       let params | |||
|       let getYear | |||
|       if (this.arcAddDate) { | |||
|         params = { | |||
|           'year': this.arcAddDate | |||
|         } | |||
|         getYear = this.arcAddDate | |||
|       } else { | |||
|         params = { | |||
|           'year': null | |||
|         } | |||
|         getYear = new Date().getFullYear() | |||
|       } | |||
|       FetchInitAddArchivesStatistics(params).then(res => { | |||
|         if (res) { | |||
|           this.addArcivesData.addArcivesMonth = [] | |||
|           res.months.forEach(item => { | |||
|             this.addArcivesData.addArcivesMonth.push(getYear + '/' + item) | |||
|           }) | |||
|           this.addArcivesData.addArcivesNum = res.nums | |||
|         } | |||
|       }) | |||
|     }, | |||
|     // array: 需要进行排序的数组
 | |||
|     // key: 根据某个属性进行排序
 | |||
|     // order: 升序/降序  true:升序 false:降序
 | |||
|     arrSortByKey(array, property, order) { | |||
|       return array.sort(function(a, b) { | |||
|         const value1 = a[property] | |||
|         const value2 = b[property] | |||
|         if (order) { // 升序
 | |||
|           return value1 - value2 | |||
|         } else { // 降序
 | |||
|           return value2 - value1 | |||
|         } | |||
|       }) | |||
|     } | |||
|   } | |||
| } | |||
| import { FetchInitBorrowerNumStatistics, FetchInitArchivesTypeNum, FetchInitArchivesTypeStatistics, FetchStorageStatistics, FetchInitArchivesSearchRanking, FetchInitAddArchivesStatistics } from '@/api/archivesManage/statistics' | |||
| // import qs from 'qs'
 | |||
| 
 | |||
| export const statisticsCrud = { | |||
|   // 组件共用属性
 | |||
|   data() { | |||
|     return { | |||
|       cateDate: '', | |||
|       typeDate: '', | |||
|       inOutStorageDate: '', | |||
|       arcSearchDate: '', | |||
|       arcAddDate: '', | |||
|       pickerOptions: { | |||
|         disabledDate(time) { | |||
|           return time.getTime() > Date.now() - 8.64e6 | |||
|         } | |||
|       }, | |||
|       lendData: [], | |||
|       cateData: [], | |||
|       typeData: [], | |||
|       storageData: { | |||
|         storageMonths: [], | |||
|         inStorageData: [], | |||
|         outStorageData: [] | |||
|       }, | |||
|       searchAcrivesData: { | |||
|         searchName: [], | |||
|         searchValue: [] | |||
|       }, | |||
|       addArcivesData: { | |||
|         addArcivesMonth: [], | |||
|         addArcivesNum: [] | |||
|       }, | |||
|       numTop: '10', | |||
|       options: [{ | |||
|         value: '10', | |||
|         label: '10' | |||
|       }, { | |||
|         value: '20', | |||
|         label: '20' | |||
|       }, { | |||
|         value: '30', | |||
|         label: '30' | |||
|       }, { | |||
|         value: '40', | |||
|         label: '40' | |||
|       }, { | |||
|         value: '50', | |||
|         label: '50' | |||
|       }] | |||
|     } | |||
|   }, | |||
|   // 组件挂载时的共用方法
 | |||
|   mounted() { | |||
|     this.getBorrowerNumSta() | |||
|     this.getArchivesTypeNum() | |||
|     this.getArchivesTypeStatistics() | |||
|     this.getStorageStatistics() | |||
|     this.getArchivesSearchRanking() | |||
|     this.getAddArchivesStatistics() | |||
|   }, | |||
|   // 组件共用方法
 | |||
|   methods: { | |||
|     // 档案借阅统计
 | |||
|     getBorrowerNumSta() { | |||
|       FetchInitBorrowerNumStatistics().then(res => { | |||
|         if (res) { | |||
|           delete res.total | |||
|           // 固定排序 '在库档案', '已借档案', '待借档案', '逾期档案', '异常档案'
 | |||
|           const borrowerArr = [] | |||
|           for (const i in res) { | |||
|             const obj = {} | |||
|             obj.name = i | |||
|             obj.value = res[i] | |||
|             if (i === 'inStorage') { | |||
|               obj.sequence = 1 | |||
|             } else if (i === 'borrow') { | |||
|               obj.sequence = 2 | |||
|             } else if (i === 'waitBorrow') { | |||
|               obj.sequence = 3 | |||
|             } else if (i === 'overdue') { | |||
|               obj.sequence = 4 | |||
|             } else if (i === 'abnormal') { | |||
|               obj.sequence = 5 | |||
|             } | |||
|             borrowerArr.push(obj) | |||
|           } | |||
|           this.arrSortByKey(borrowerArr, 'sequence', false) | |||
|           borrowerArr.forEach(item => { | |||
|             this.lendData.push(item.value) | |||
|           }) | |||
|         } | |||
|       }) | |||
|     }, | |||
|     // 档案类别 - 年选择
 | |||
|     handleCateDate() { | |||
|       this.cateData = [] | |||
|       this.getArchivesTypeNum() | |||
|     }, | |||
|     // 档案类别
 | |||
|     getArchivesTypeNum() { | |||
|       let params | |||
|       if (this.cateDate) { | |||
|         params = { | |||
|           'year': this.cateDate | |||
|         } | |||
|       } else { | |||
|         params = { | |||
|           'year': null | |||
|         } | |||
|       } | |||
|       FetchInitArchivesTypeNum(params).then(res => { | |||
|         if (res) { | |||
|           for (const i in res) { | |||
|             this.cateData.push(res[i]) | |||
|           } | |||
|         } | |||
|       }) | |||
|     }, | |||
|     // 档案类型 - 月选择
 | |||
|     handleTypeDate() { | |||
|       this.typeData = [] | |||
|       this.getArchivesTypeStatistics() | |||
|     }, | |||
|     // 档案类型
 | |||
|     getArchivesTypeStatistics() { | |||
|       let params | |||
|       if (this.typeDate) { | |||
|         params = { | |||
|           'yearMonth': this.typeDate | |||
|         } | |||
|       } else { | |||
|         params = { | |||
|           'yearMonth': null | |||
|         } | |||
|       } | |||
|       FetchInitArchivesTypeStatistics(params).then(res => { | |||
|         if (res) { | |||
|           res.map(item => { | |||
|             const obj = {} | |||
|             obj.name = item.archivesType | |||
|             obj.value = item.archivesNum | |||
|             this.typeData.push(obj) | |||
|           }) | |||
|         } | |||
|       }) | |||
|     }, | |||
|     // 档案类别 - 年选择
 | |||
|     handleStorageDate() { | |||
|       this.getStorageStatistics() | |||
|     }, | |||
|     // 出入库管理情况
 | |||
|     getStorageStatistics() { | |||
|       let params | |||
|       let getYear | |||
|       if (this.inOutStorageDate) { | |||
|         params = { | |||
|           'year': this.inOutStorageDate | |||
|         } | |||
|         getYear = this.inOutStorageDate | |||
|       } else { | |||
|         params = { | |||
|           'year': null | |||
|         } | |||
|         getYear = new Date().getFullYear() | |||
|       } | |||
|       FetchStorageStatistics(params).then(res => { | |||
|         if (res) { | |||
|           this.storageData.storageMonths = [] | |||
|           res.months.forEach(item => { | |||
|             this.storageData.storageMonths.push(getYear + '/' + item) | |||
|           }) | |||
|           this.storageData.inStorageData = res.inStorage | |||
|           this.storageData.outStorageData = res.outStorage | |||
|         } | |||
|       }) | |||
|     }, | |||
|     handleSearchDate() { | |||
|       this.getArchivesSearchRanking() | |||
|     }, | |||
|     selectNumTop(val) { | |||
|       this.numTop = val | |||
|       this.searchAcrivesData = { | |||
|         searchName: [], | |||
|         searchValue: [] | |||
|       } | |||
|       this.getArchivesSearchRanking() | |||
|     }, | |||
|     // 档案检索排名
 | |||
|     getArchivesSearchRanking() { | |||
|       let params | |||
|       if (this.arcSearchDate) { | |||
|         params = { | |||
|           'yearMonth': this.arcSearchDate, | |||
|           'top': this.numTop | |||
|         } | |||
|       } else { | |||
|         params = { | |||
|           'yearMonth': null, | |||
|           'top': this.numTop | |||
|         } | |||
|       } | |||
|       FetchInitArchivesSearchRanking(params).then(res => { | |||
|         if (res) { | |||
|           this.arrSortByKey(res, 'num', true) | |||
|           this.searchAcrivesData.searchName = res.map(item => item.cnName) | |||
|           this.searchAcrivesData.searchValue = res.map(item => item.num) | |||
|         } | |||
|       }) | |||
|     }, | |||
|     handleArcAddSta() { | |||
|       this.getAddArchivesStatistics() | |||
|     }, | |||
|     // 档案实际情况
 | |||
|     getAddArchivesStatistics() { | |||
|       let params | |||
|       let getYear | |||
|       if (this.arcAddDate) { | |||
|         params = { | |||
|           'year': this.arcAddDate | |||
|         } | |||
|         getYear = this.arcAddDate | |||
|       } else { | |||
|         params = { | |||
|           'year': null | |||
|         } | |||
|         getYear = new Date().getFullYear() | |||
|       } | |||
|       FetchInitAddArchivesStatistics(params).then(res => { | |||
|         if (res) { | |||
|           this.addArcivesData.addArcivesMonth = [] | |||
|           res.months.forEach(item => { | |||
|             this.addArcivesData.addArcivesMonth.push(getYear + '/' + item) | |||
|           }) | |||
|           this.addArcivesData.addArcivesNum = res.nums | |||
|         } | |||
|       }) | |||
|     }, | |||
|     // array: 需要进行排序的数组
 | |||
|     // key: 根据某个属性进行排序
 | |||
|     // order: 升序/降序  true:升序 false:降序
 | |||
|     arrSortByKey(array, property, order) { | |||
|       return array.sort(function(a, b) { | |||
|         const value1 = a[property] | |||
|         const value2 = b[property] | |||
|         if (order) { // 升序
 | |||
|           return value1 - value2 | |||
|         } else { // 降序
 | |||
|           return value2 - value1 | |||
|         } | |||
|       }) | |||
|     } | |||
|   } | |||
| } | |||
						Write
						Preview
					
					
					Loading…
					
					Cancel
						Save
					
		Reference in new issue