Browse Source

优化

master
xuhuajiao 3 weeks ago
parent
commit
4cf99d8093
  1. 4
      .env.development
  2. 31
      src/api/system/documentArchives.js
  3. 2
      src/views/archivesMIOD/miodLibrary/index.vue
  4. 79
      src/views/archivesMIOD/miodLibrary/module/detail.vue
  5. 9
      src/views/archivesMIOD/miodLibrary/treeList.vue
  6. 48
      src/views/archivesMIOD/miodRecord/index.vue
  7. 68
      src/views/archivesMIOD/miodStatistics/miodTable.vue
  8. 63
      src/views/system/borrowerManage/index.vue
  9. 38
      src/views/system/officialDocumentParams/index.vue

4
.env.development

@ -3,8 +3,8 @@ ENV = 'development'
# 接口地址
# 许镇-本地服地址
# VUE_APP_BASE_API = 'http://192.168.99.72:13000'
VUE_APP_BASE_API = 'http://192.168.99.67:13000'
VUE_APP_BASE_API = 'http://192.168.99.72:13000'
# VUE_APP_BASE_API = 'http://192.168.99.67:13000'
VUE_APP_AIDEEPSEEK_API = 'http://192.168.99.86:12123'
VUE_APP_PROCESSMODEL_API = 'http://192.168.99.72:11200'
VUE_APP_SDEVID = "D002"

31
src/api/system/documentArchives.js

@ -252,6 +252,14 @@ export function FetchAnnualStatisticsByMonth(params) {
})
}
// 馆藏传阅统计
export function FetchAnnualStatisticsByBorrow(params) {
return request({
url: 'api/documentArchives/annualStatisticsByBorrow' + '?' + qs.stringify(params, { indices: false }),
method: 'get'
})
}
// 读取公文标签
export function FetchReadGW(params) {
return request({
@ -311,6 +319,24 @@ export function FetchLend(data) {
})
}
// 归还
export function FetchDocumentReturn(data) {
return request({
url: 'api/borrow/documentReturn',
method: 'post',
data
})
}
// 阅读者密码初始化
export function FetchBorrowerPassInit(data) {
return request({
url: 'api/documentArchives/borrowerPassInit',
method: 'post',
data
})
}
export default {
FetchInitDocumentParam,
updateDocumentParam,
@ -340,11 +366,14 @@ export default {
FetchFindGroupType,
FetchAnnualStatistics,
FetchAnnualStatisticsByMonth,
FetchAnnualStatisticsByBorrow,
FetchReadGW,
FetchReadPatron,
FetchBindReadNo,
FetchUnbindReadNo,
FetchDownloadBorrower,
FetchArchivesDetailsBorrowLog,
FetchLend
FetchLend,
FetchDocumentReturn,
FetchBorrowerPassInit
}

2
src/views/archivesMIOD/miodLibrary/index.vue

@ -304,7 +304,7 @@ export default {
this.crud.query.docDepartment = this.selectedDocument.label
this.crud.query.archiveYear = null
} else if (this.selectedDocument.isType === 4) {
this.crud.query.docDepartment = null
this.crud.query.docDepartment = this.selectedDocument.dictionaryName
this.crud.query.archiveYear = this.selectedDocument.label
} else {
this.search = ''

79
src/views/archivesMIOD/miodLibrary/module/detail.vue

@ -33,9 +33,11 @@
</div>
<div style="display: flex; justify-content: space-between; align-items: center; margin-top: 20px; margin-bottom: 10px; padding: 0 20px 0 10px;">
<h4 style="font-size: 16px; color: #1c1c1c;">文件列表</h4>
<el-button v-if="archivesFiledata.length !== 0 && !isMidoRecord" size="mini" style="padding: 7px 7px 7px 10px; " @click="handleAddDocDetails">
<i class="iconfont icon-tianjiawenjian" />
</el-button>
<div v-if="archivesFiledata.length !== 0 && !isMidoRecord">
<el-tooltip class="item" effect="dark" content="点击新增复印件" placement="top">
<el-button class="add-file-miod" style="padding: 7px 7px 7px 10px; " @click="handleAddDocDetails"><i class="iconfont icon-tianjiawenjian" /></el-button>
</el-tooltip>
</div>
</div>
<el-table
v-loading="archivesFiledataLoading"
@ -65,33 +67,49 @@
<span v-else class="row-state defalut-state">未绑定</span>
</template>
</el-table-column>
<el-table-column v-if="!isMidoRecord" prop="update_time" label="操作" min-width="160">
<el-table-column v-if="!isMidoRecord" prop="update_time" label="操作" min-width="140">
<template slot-scope="scope">
<!-- 绑定标签 -->
<el-button
:loading="bindLoading[scope.row.id]"
style="padding: 4px 4px 4px 6px !important; color: #0348f3 !important; background-color: #dcedfd !important; border: 1px solid #9bd1ff !important;"
@click="bindingTag(scope.row)"
><i class="iconfont icon-bendiguajie" /></el-button>
<!-- 解绑标签 -->
<el-button
:loading="unbindBtnLoading[scope.row.id]"
style="padding: 4px 4px 4px 6px !important; color: #ff8329 !important; background-color: #fff3e5 !important; border: 1px solid #febd98 !important;"
@click="handleUnbind(scope.row)"
><i class="iconfont icon-jiebang" /></el-button>
<!-- 删除文件 -->
<el-button
v-if="scope.row.details_type !== 1"
:loading="deleteBtnLoading[scope.row.id]"
style="padding: 4px 6px 4px 6px !important; color: #ed4a41!important; background-color: #fcece9 !important; border: 1px solid #fbc0b5 !important;"
@click="toDelete(scope.row)"
><i class="iconfont icon-shanchu" /></el-button>
<div style="display: inline-block;">
<el-tooltip class="item" effect="dark" content="绑定标签" placement="top">
<!-- 绑定标签 -->
<el-button
:loading="bindLoading[scope.row.id]"
style="padding: 4px 4px 4px 6px !important; color: #0348f3 !important; background-color: #dcedfd !important; border: 1px solid #9bd1ff !important;"
@click="bindingTag(scope.row)"
><i class="iconfont icon-bendiguajie" /></el-button>
</el-tooltip>
</div>
<div style="display: inline-block;">
<el-tooltip class="item" effect="dark" content="解绑标签" placement="top">
<!-- 解绑标签 -->
<el-button
:loading="unbindBtnLoading[scope.row.id]"
style="padding: 4px 4px 4px 6px !important; color: #ff8329 !important; background-color: #fff3e5 !important; border: 1px solid #febd98 !important;"
@click="handleUnbind(scope.row)"
><i class="iconfont icon-jiebang" /></el-button>
</el-tooltip>
</div>
<div v-if="scope.row.details_type !== 1" style="display: inline-block; ">
<el-tooltip class="item" effect="dark" content="删除复印件" placement="top">
<!-- 删除文件 -->
<el-button
:loading="deleteBtnLoading[scope.row.id]"
style="padding: 4px 6px 4px 6px !important; color: #ed4a41!important; background-color: #fcece9 !important; border: 1px solid #fbc0b5 !important;"
@click="toDelete(scope.row)"
><i class="iconfont icon-shanchu" /></el-button>
</el-tooltip>
</div>
</template>
</el-table-column>
<el-table-column v-if="!isMidoRecord" prop="update_time" label="传阅操作" min-width="80" align="center">
<template slot-scope="scope">
<!-- 传阅 - 选择用户 -->
<el-button v-if="scope.row.read_type!=='传阅中'" :loading="lendBtnLoading[scope.row.id]" style="padding: 4px 2px 4px 6px !important; color: #0348f3 !important; background-color: #dcedfd !important; border: 1px solid #9bd1ff !important;" @click="handleLendFile(scope.row)"><i class="iconfont icon-liuchengfaqi" /></el-button>
<div v-if="scope.row.read_type!=='传阅中'">
<el-tooltip class="item" effect="dark" content="传阅" placement="top">
<!-- 传阅 - 选择用户 -->
<el-button :loading="lendBtnLoading[scope.row.id]" style="padding: 4px 2px 4px 6px !important; color: #0348f3 !important; background-color: #dcedfd !important; border: 1px solid #9bd1ff !important;" @click="handleLendFile(scope.row)"><i class="iconfont icon-liuchengfaqi" /></el-button>
</el-tooltip>
</div>
</template>
</el-table-column>
</el-table>
@ -686,6 +704,7 @@ export default {
const params = {
documentId: documentId,
archivesId: datas.id, // this.currentArchivesId,
parentsId: datas.parents_id,
regNo: datas.reg_no,
isDestroy: true,
tid: datas.tid ? datas.tid : null // id
@ -733,11 +752,6 @@ export default {
})
},
handleComfireDepts() {
// if (this.miodDeptsSelections.length === 0) {
// this.$message.warning('/')
// return
// }
// this.miodDeptsTags = [...this.miodDeptsSelections]
if (this.singleSelectedDept !== null) {
const param = {
'borrowDocumentTid': this.currentLendData.reg_no,
@ -746,12 +760,12 @@ export default {
console.log('param', param)
FetchLend(param).then((res) => {
console.log('resLend', res)
if (res.code !== -1) {
if (res.code !== '-1') {
this.$message({ message: res.msg, type: 'success', offset: 8 })
this.getInitDocumentDetailsList()
} else {
this.$message({ message: res.msg, type: 'error', offset: 8 })
}
this.getInitDocumentDetailsList()
this.deptsVisible = false
this.$set(this.lendBtnLoading, this.currentLendData.id, false)
}).catch(error => {
@ -864,4 +878,5 @@ export default {
color: #545B65;
}
}
</style>

9
src/views/archivesMIOD/miodLibrary/treeList.vue

@ -69,8 +69,6 @@ export default {
},
methods: {
refreshData() {
console.log('refreshTreeList', this.currentTreeVal)
//
if (this.currentTreeVal) {
this.nodeToSelect = {
@ -115,13 +113,12 @@ export default {
documentId: child.id,
dictionaryName: department.dictionaryName,
label: year,
id: year,
id: year + department.dictionaryName,
isType: 4
}))
}))
}))
}))
console.log(' this.crud.data', this.crud.data)
// document
// this.$nextTick(() => {
// const defaultSelectedNode = this.findFirstIsType2Node(this.crud.data)
@ -137,7 +134,6 @@ export default {
//
console.log('this.nodeToSelect', this.nodeToSelect)
if (this.nodeToSelect) {
console.log('this.nodeToSelect.isType', this.nodeToSelect.isType)
switch (this.nodeToSelect.isType) {
case 4: //
targetNode = this.findNodeByDocumentIdAndDictionaryName(
@ -172,11 +168,14 @@ export default {
//
if (!targetNode) {
console.log('2222')
targetNode = this.findFirstIsType2Node(this.crud.data)
}
//
if (targetNode) {
console.log('111')
console.log(targetNode.id)
this.$refs.tree.setCurrentKey(targetNode.id)
this.handleNodeClick(targetNode)
}

48
src/views/archivesMIOD/miodRecord/index.vue

@ -48,7 +48,7 @@
@cell-dblclick="tableDoubleClick"
>
<el-table-column prop="reg_no" label="公文登记号" width="120" />
<el-table-column prop="maintitle" label="公文题名" min-width="140" />
<el-table-column prop="maintitle" label="公文题名" min-width="140" show-overflow-tooltip />
<el-table-column prop="details_type" label="文件类型">
<template slot-scope="scope">
<el-tag v-if="scope.row.details_type === 1">原件</el-tag>
@ -104,9 +104,9 @@
<script>
import CRUD, { presenter, crud } from '@crud/crud'
import { FetchDocumentReturn } from '@/api/system/documentArchives'
import pagination from '@crud/Pagination'
import DateRangePicker from '@/components/DateRangePicker'
import { FetchBusinessFlowDetails } from '@/api/archivesManage/library'
import MidoArchivesInfo from '@/views/archivesMIOD/miodLibrary/module/detail'
// import { parseTime } from '@/utils/index'
@ -169,12 +169,16 @@ export default {
// this.crud.query[this.typeInputkey] = e
},
clearInputValue(val) {
console.log('val', val)
this.inputSelect = val
this.typeValue = ''
// ,typeInputkeyform
if (this.typeInputkey) {
delete this.crud.query[this.typeInputkey]
}
this.crud.query.readType = val
this.crud.query.search = this.typeValue
this.crud.toQuery()
},
getDescByValue(inputValue, data, inputKey = 'value', outputKey = 'value') {
let outputValue = ''
@ -221,27 +225,6 @@ export default {
this.crud.query.lastEndTime = null
this.crud.toQuery()
},
getBusinessFlowDetails(row) {
const params = {
'businessId': row.businessFlowId,
'page': 0,
'size': '999'
}
FetchBusinessFlowDetails(params).then((res) => {
if (res.code !== 500) {
this.rowCurrent = res.businessFlow
res.details.content.forEach(item => {
item.utilizeType = item.utilizeType.split(',').map(Number)
})
this.detailArcData = res.details.content
console.log(this.detailArcData)
} else {
this.$message({ message: '获取数据失败', type: 'error', offset: 8 })
}
}).catch(err => {
console.log(err)
})
},
tableDoubleClick(row) {
console.log('row', row)
this.parentInfo = row
@ -260,8 +243,23 @@ export default {
type: 'warning',
dangerouslyUseHTMLString: true
}).then(() => {
console.log('row222', row)
this.$set(this.returnBtnLoading, index, false)
const param = {
'documentTid': row.reg_no
}
console.log('param', param)
FetchDocumentReturn(param).then((res) => {
console.log('resReturn', res)
if (res.code !== '-1') {
this.$message({ message: res.msg, type: 'success', offset: 8 })
} else {
this.$message({ message: res.msg, type: 'error', offset: 8 })
}
this.crud.toQuery()
this.$set(this.returnBtnLoading, index, false)
}).catch(error => {
console.error(error)
this.$set(this.returnBtnLoading, index, false)
})
}).catch(() => {
this.$set(this.returnBtnLoading, index, false)
})

68
src/views/archivesMIOD/miodStatistics/miodTable.vue

@ -32,7 +32,7 @@
<el-table-column
:prop="getFirstColumnProp()"
:label="getFirstColumnLabel()"
width="60"
width="80"
align="center"
/>
<el-table-column
@ -58,7 +58,7 @@
<script>
import CRUD, { presenter, crud } from '@crud/crud'
import { getCurrentTime } from '@/utils/index'
import { FetchAnnualStatistics, FetchAnnualStatisticsByMonth } from '@/api/system/documentArchives'
import { FetchAnnualStatistics, FetchAnnualStatisticsByMonth, FetchAnnualStatisticsByBorrow } from '@/api/system/documentArchives'
import * as XLSX from 'xlsx'
import { saveAs } from 'file-saver' //
@ -126,7 +126,7 @@ export default {
this.getAnnualStatisticsByMonth()
break
case 2:
// this.getCirculationStatistics()
this.getAnnualStatisticsByBorrow()
break
default:
break
@ -134,12 +134,16 @@ export default {
},
handleYear(val) {
this.tableDataLoading = true
this.tableData = []
this.yearValue = val
this.getAnnualStatisticsByMonth()
},
handleCustomYear(val) {
console.log('this.customYear', this.customYear)
console.log('this.val', val)
this.tableDataLoading = true
this.tableData = []
this.getAnnualStatisticsByBorrow()
},
getFirstColumnProp() {
switch (this.activeIndex) {
@ -181,6 +185,22 @@ export default {
console.log(err)
})
},
getAnnualStatisticsByBorrow() {
console.log('customYear', this.customYear)
const params = {
'startTime': this.customYear[0],
'endTime': this.customYear[1]
}
console.log('params', params)
FetchAnnualStatisticsByBorrow(params).then((res) => {
this.tableData = this.formatTableData('name', res)
setTimeout(() => {
this.tableDataLoading = false
}, 500)
}).catch(err => {
console.log(err)
})
},
formatTableData(dataType, rawData) {
const allColumns = new Set()
Object.keys(rawData).forEach(key => {
@ -217,6 +237,11 @@ export default {
sortedKeys = Object.keys(rawData)
.filter(key => key !== '合计')
.sort((a, b) => parseInt(a) - parseInt(b))
} else if (dataType === 'name') {
//
sortedKeys = Object.keys(rawData)
.filter(key => key !== '合计')
.sort((a, b) => a.localeCompare(b))
} else {
//
sortedKeys = Object.keys(rawData).filter(key => key !== '合计')
@ -227,14 +252,16 @@ export default {
const values = rawData[key]
const item = dataType === 'year'
? { year: key, ...values } //
: { month: `${key}`, ...values } //
: dataType === 'month'
? { month: `${key}`, ...values } //
: { name: key, ...values } //
formattedData.push(item)
})
//
if (rawData['合计']) {
formattedData.push({
[dataType === 'year' ? 'year' : 'month']: '合计',
[dataType === 'year' ? 'year' : dataType === 'month' ? 'month' : 'name']: '合计',
...rawData['合计']
})
}
@ -242,7 +269,29 @@ export default {
return formattedData
},
getExportMeta() {
console.log('this.customYear', this.customYear)
let sheetName, firstColumnLabel, firstColumnProp
const formatDateRange = (dates) => {
if (!dates || dates.length !== 2) return ''
//
const formatDate = (dateStr) => {
const date = new Date(dateStr)
const year = date.getFullYear()
const month = String(date.getMonth() + 1).padStart(2, '0')
const day = String(date.getDate()).padStart(2, '0')
return `${year}${month}${day}`
}
const startDate = formatDate(dates[0])
const endDate = formatDate(dates[1])
return `${startDate}-${endDate}`
}
const dateRange = formatDateRange(this.customYear)
switch (this.activeIndex) {
case 0:
sheetName = '馆藏年度统计'
@ -256,7 +305,7 @@ export default {
firstColumnProp = 'month' // '1'
break
case 2:
sheetName = '传阅统计'
sheetName = `传阅统计_${dateRange}`
firstColumnLabel = '借阅者'
firstColumnProp = 'name' //
break
@ -299,6 +348,13 @@ export default {
// sheetName
const fileName = `${sheetName}_${new Date().getTime()}.xlsx`
// const now = new Date()
// const fileName = `${sheetName}_${now.getFullYear()}-${
// String(now.getMonth() + 1).padStart(2, '0')}-${
// String(now.getDate()).padStart(2, '0')}_${
// String(now.getHours()).padStart(2, '0')}-${
// String(now.getMinutes()).padStart(2, '0')}-${
// String(now.getSeconds()).padStart(2, '0')}.xlsx`
const wbout = XLSX.write(workbook, { bookType: 'xlsx', type: 'array', cellDates: true })
const blob = new Blob([wbout], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' })
saveAs(blob, fileName)

63
src/views/system/borrowerManage/index.vue

@ -102,27 +102,12 @@
</div>
</div>
</el-dialog>
<!-- 密码重置dialog -->
<el-dialog class="tip-dialog" :visible.sync="resetVisible" :modal-append-to-body="false" append-to-body :close-on-click-modal="false" title="提示">
<div class="setting-dialog">
<div class="tip-content">
<p class="tipMsg">此操作将重置所选借阅者密码为"123456"</p>
<span>你是否还要继续?</span>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="resetVisible = false">取消</el-button>
<el-button v-loading="btnLoading" type="primary" @click="pwdReset(crud.selections)">继续</el-button>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
import crudBorrower from '@/api/system/borrower'
import { FetchReadPatron, FetchBindReadNo, FetchUnbindReadNo } from '@/api/system/documentArchives'
import { FetchReadPatron, FetchBindReadNo, FetchUnbindReadNo, FetchBorrowerPassInit } from '@/api/system/documentArchives'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
@ -169,9 +154,7 @@ export default {
]
},
bindLoading: false,
unbindBtnLoading: false,
resetVisible: false,
btnLoading: false
unbindBtnLoading: false
}
},
computed: {
@ -305,25 +288,29 @@ export default {
}
},
//
handlePwdReset() {
this.resetVisible = true
},
//
pwdReset(data) {
const params = data.map(item => { return item.borrowName })
console.log('params', params)
// this.btnLoading = true
// resetpassword(params).then(res => {
// if (res === 'SUCCESS') {
// this.$message({ message: '', type: 'success', offset: 8 })
// this.resetVisible = false
// this.btnLoading = false
// this.crud.refresh()
// } else {
// this.$message({ message: '', type: 'error', offset: 8 })
// this.btnLoading = false
// }
// })
handlePwdReset(data) {
this.$confirm('此操作将重置所选借阅者密码为"123456"' + '<span>你是否还要继续?</span>', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
dangerouslyUseHTMLString: true
}).then(() => {
const params = {
'id': data[0].id
}
console.log('params', params)
FetchBorrowerPassInit(params).then(res => {
console.log('res', res)
if (res.code !== 500) {
this.$message({ message: '重置密码成功', type: 'success', offset: 8 })
this.crud.refresh()
} else {
this.$message({ message: '重置密码失败', type: 'error', offset: 8 })
}
})
}).catch((err) => {
console.log(err)
})
}
}
}

38
src/views/system/officialDocumentParams/index.vue

@ -27,7 +27,10 @@
</div>
<div class="row-line-style">
<el-form-item label="启用借阅密码" prop="borrow_pwd_use">
<el-checkbox v-model="form.borrow_pwd_use" />
<el-checkbox
v-model="form.borrow_pwd_use"
@change="handlePwdChange"
/>
</el-form-item>
</div>
</div>
@ -86,7 +89,7 @@ import { verifyMaintenance } from '@/api/system/fileLibraryField'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import { mapGetters } from 'vuex'
const defaultForm = { become_warning: null, circulate_term: null, registra_num_rule: null, borrow_max: null, rfid_api_url: null, ip: null, port: null, borrow_pwd_use: 0 }
const defaultForm = { become_warning: null, circulate_term: null, registra_num_rule: null, borrow_max: null, rfid_api_url: null, ip: null, port: null, borrow_pwd_use: null }
export default {
name: 'ParamSetting',
@ -202,9 +205,7 @@ export default {
borrow_max: [
{ required: true, message: '最大借阅量不可为空', trigger: 'blur' }
],
borrow_pwd_use: [
],
borrow_pwd_use: [{ required: true, message: '请选择是否启用借阅密码', trigger: 'change' }],
registra_num_rule: [
{ required: true, message: '顺序号位数不可为空', trigger: 'blur' }
]
@ -242,10 +243,24 @@ export default {
this.crud.form.become_warning = res.become_warning
this.crud.form.circulate_term = res.circulate_term
this.crud.form.registra_num_rule = res.registra_num_rule
this.crud.form.borrow_max = res.borrow_max
// http://192.168.99.67:8780"
this.crud.form.rfid_api_url = res.rfid_api_url
const url = res.rfid_api_url
const match = url.match(/^(https?:\/\/)?([^:/]+)(?::(\d+))?/)
if (match) {
this.crud.form.ip = match[2]
this.crud.form.port = match[3]
} else {
console.error('URL 格式不正确')
}
this.crud.form.borrow_pwd_use = res.borrow_pwd_use === '1'
}).catch(() => {
})
},
handlePwdChange(val) {
console.log('是否启用密码:', val)
},
[CRUD.HOOK.beforeToCU](crud, form, btn) {
},
@ -270,17 +285,24 @@ export default {
this.verifyLoading = true
if (this.verifyStatus === 'add') {
const convertFormData = (formData) => {
const excludeFields = ['ip', 'port'] //
const result = []
for (const code in formData) {
if (formData.hasOwnProperty(code)) {
if (formData.hasOwnProperty(code) && !excludeFields.includes(code)) {
let value = formData[code]
if (code === 'borrow_pwd_use') {
value = value === true ? 1 : 0
}
result.push({
code,
remarks: formData[code]
remarks: value.toString()
})
}
}
return result
}
const data = convertFormData(this.crud.form)
console.log(data)
crudDocumentArchives.updateDocumentParam(data).then(res => {

Loading…
Cancel
Save