diff --git a/src/api/archivesManage/lendManage.js b/src/api/archivesManage/lendManage.js index d62f284..ee279f2 100644 --- a/src/api/archivesManage/lendManage.js +++ b/src/api/archivesManage/lendManage.js @@ -1,7 +1,5 @@ import request from '@/utils/request' -// import qs from 'qs' - // 判断档案是否可以借阅 export function FetchIsExistBorrow(parameter) { return request({ @@ -146,5 +144,30 @@ export function FetchArchivesReturnConfirm(parameter) { }) } -export default { } +// 借阅者管理 +export function add(data) { + return request({ + url: 'api/borrow/editBorrower', + method: 'post', + data + }) +} + +export function del(data) { + return request({ + url: 'api/borrow/deleteBorrower', + method: 'post', + data + }) +} + +export function edit(data) { + return request({ + url: 'api/borrow/editBorrower', + method: 'post', + data + }) +} + +export default { add, edit, del } diff --git a/src/views/archivesManage/lendManage/borrowerManage/index.vue b/src/views/archivesManage/lendManage/borrowerManage/index.vue index e89099e..b219b71 100644 --- a/src/views/archivesManage/lendManage/borrowerManage/index.vue +++ b/src/views/archivesManage/lendManage/borrowerManage/index.vue @@ -2,13 +2,20 @@
- 新增 + + + 新增 + + + 修改 + + 删除
- - - - - + + + + + + + - - @@ -50,7 +59,7 @@

您确定要删除当前借阅人信息吗?

@@ -60,68 +69,76 @@ diff --git a/src/views/archivesManage/lendManage/borrowerManage/module/editBorrower.vue b/src/views/archivesManage/lendManage/borrowerManage/module/editBorrower.vue deleted file mode 100644 index d90b962..0000000 --- a/src/views/archivesManage/lendManage/borrowerManage/module/editBorrower.vue +++ /dev/null @@ -1,119 +0,0 @@ - - - - - diff --git a/src/views/archivesManage/lendManage/components/archiveDetail.vue b/src/views/archivesManage/lendManage/components/archiveDetail.vue index 74c7b48..2b8ab05 100644 --- a/src/views/archivesManage/lendManage/components/archiveDetail.vue +++ b/src/views/archivesManage/lendManage/components/archiveDetail.vue @@ -5,16 +5,16 @@
-

单据号:{{ rowData.orderNo }}

-

借阅人:{{ rowData.borrowerName }}

-

所属部门:{{ rowData.department }}

-

证件类型:{{ rowData.cardType }}

-

证件号码:{{ rowData.idcard }}

-

电话号码:{{ rowData.phone }}

-

借阅目的:{{ rowData.purpose }}

-

借阅日期:{{ lendDates }}

-

借阅状态:{{ rowData.borrowType | borrowStatus }}

-

操作时间:{{ rowData.createTime | parseTime }}

+

单据号:{{ otherInfo.id }}

+

借阅人:{{ borrowerInfo.borrowerName }}

+

所属部门:{{ borrowerInfo.department }}

+

证件类型:{{ borrowerInfo.cardType }}

+

证件号码:{{ borrowerInfo.idcard }}

+

电话号码:{{ borrowerInfo.phone }}

+

借阅目的:{{ otherInfo.purpose }}

+

借阅日期:{{ lendDatesInfo }}

+

借阅状态:{{ otherInfo.borrow_type | borrowStatus }}

+

操作时间:{{ otherInfo.create_time | parseTime }}

@@ -45,8 +45,10 @@ export default { return { detailVisible: false, rowData: {}, + borrowerInfo: {}, + otherInfo: {}, tableData: [], - lendDates: null + lendDatesInfo: null } }, methods: { @@ -55,8 +57,10 @@ export default { 'orderNo': this.rowData.orderNo } FetchInitBillDetails(params).then(data => { + this.otherInfo = data + this.borrowerInfo = data.borrower this.tableData = data.borrowArchives - this.lendDates = parseTime(data.borrow_start, '{y}-{m}-{d}') + ' 至 ' + parseTime(data.borrow_end, '{y}-{m}-{d}') + this.lendDatesInfo = parseTime(data.borrow_start, '{y}-{m}-{d}') + ' 至 ' + parseTime(data.borrow_end, '{y}-{m}-{d}') }) } } diff --git a/src/views/archivesManage/lendManage/index.vue b/src/views/archivesManage/lendManage/index.vue index 17ecf2e..48d8d7d 100644 --- a/src/views/archivesManage/lendManage/index.vue +++ b/src/views/archivesManage/lendManage/index.vue @@ -30,6 +30,7 @@ import lendQuery from './lendQuery/index.vue' import borrowerManage from './borrowerManage/index.vue' import lendProcess from './lendProcess/index.vue' import lendArchivesList from './components/lendArchivesList' +import { lendingCrud } from './mixins/lending' export default { name: 'BorrowManage', @@ -42,6 +43,7 @@ export default { lendProcess, lendArchivesList }, + mixins: [lendingCrud], data() { return { activeIndex: 0, diff --git a/src/views/archivesManage/lendManage/lendConfirm/index.vue b/src/views/archivesManage/lendManage/lendConfirm/index.vue index 41b6838..35e1576 100644 --- a/src/views/archivesManage/lendManage/lendConfirm/index.vue +++ b/src/views/archivesManage/lendManage/lendConfirm/index.vue @@ -14,7 +14,7 @@ :data="crud.data" style="min-width: 100%" @select-all="selectAll" - @selection-change="crud.selectionChangeHandler" + @selection-change="selectionChangeHandler" @row-click="clickRowHandler" @row-dblclick="handleDbClick" @select="handleCurrentChange" @@ -96,22 +96,14 @@ export default { this.getBorrowRule() }, methods: { - selectionChangeHandler(val) { - this.selections = val - }, - // 档案详情 - handleDbClick(row) { - this.$refs.table.clearSelection() - this.$nextTick(() => { - const archiveDetailDom = this.$refs.archiveDetailDom - archiveDetailDom.detailVisible = true - archiveDetailDom.rowData = row - archiveDetailDom.getBillDetails() - }) - }, // table - 全选 selectAll(val) { this.selections = val + if (this.selections.length === 1) { + this.$emit('getSelections', this.selections[0]) + } else { + this.$emit('getSelections', null) + } }, // 触发单选 handleCurrentChange(selection, row) { @@ -125,12 +117,11 @@ export default { clickRowHandler(row) { this.$refs.table.clearSelection() this.$refs.table.toggleRowSelection(row) - this.selections.push(row) + // this.selections.push(row) this.$emit('getSelections', row) }, // 重新登记返回上一级 handelReRecord() { - console.log(this.selections) const params = this.selections.map(item => item.orderNo) FetchReRegister(params).then(data => { console.log(data) @@ -157,13 +148,15 @@ export default { if (this.lineStateVal === 'offline') { // 离线 this.$refs.lendDialogDom.lendSelections = this.selections - this.$refs.lendDialogDom.lendFormVisible = true this.$refs.lendDialogDom.getLendTid() } else { // 在线 const params = this.selections.map(item => item.orderNo) + console.log(this.selections) + console.log(params) this.handleConfirmLend(params, this.selections) } + this.$emit('getSelections', null) } } } diff --git a/src/views/archivesManage/lendManage/lendConfirm/module/lendDialog.vue b/src/views/archivesManage/lendManage/lendConfirm/module/lendDialog.vue index dfd1e0d..8d2ed3a 100644 --- a/src/views/archivesManage/lendManage/lendConfirm/module/lendDialog.vue +++ b/src/views/archivesManage/lendManage/lendConfirm/module/lendDialog.vue @@ -35,8 +35,9 @@ import RFID from '@/api/RFID/RFID' import { FetchReadyBorrowShowTid } from '@/api/archivesManage/lendManage' import { lendingCrud } from '../../mixins/lending' +import { form } from '@crud/crud' export default { - mixins: [lendingCrud], + mixins: [lendingCrud, form({})], data() { return { lendFormVisible: false, @@ -51,12 +52,11 @@ export default { } }, mounted() { - }, methods: { - async fn(n) { + async fn(n, eas) { return new Promise(async(resolve, reject) => { - const params = { op: 'RFID_WriteEPC', sDevID: this.devId, EAS: '0', Type: this.table[n].tagType, Code: this.table[n].archivesId, Tid: this.table[n].tid } + const params = { op: 'RFID_WriteEPC', sDevID: this.devId, EAS: eas, Type: this.table[n].tagType, Code: this.table[n].archivesId, Tid: this.table[n].tid } let writeRes = await RFID.writeEPC(params) writeRes = JSON.parse(writeRes) console.log(writeRes) @@ -76,7 +76,6 @@ export default { }, 2000) } else { const index = this.table.findIndex((item) => item.warnState === '解除失败') - console.log(index) if (index === -1) { const params = this.lendSelections.map(item => item.orderNo) this.handleConfirmLend(params, this.lendSelections) @@ -115,15 +114,15 @@ export default { this.table[n].warnState = '解除失败' this.btnDisabled = false this.unbindWarnLoading = false + this.n = this.n + 1 this.flagNum = 0 + this.flagNum++ this.$message({ message: '读写器超时未响应', type: 'error' }) } - if (this.n !== this.table.length - 1) { - this.n = this.n + 1 - this.flagNum++ + if (this.n !== this.table.length) { this.btnDisabled = true this.unbindWarnLoading = true clearTimeout(this.timer) @@ -139,17 +138,23 @@ export default { this.flagNum++ this.btnDisabled = true this.unbindWarnLoading = true - this.fn(this.n) + this.fn(this.n, 0) }, getLendTid() { const params = this.lendSelections.map(item => item.orderNo) FetchReadyBorrowShowTid(params).then(data => { if (data) { this.table = data.archives - this.table.forEach(item => { - item.warnState = '未解除' - }) - this.n = 0 + if (this.table.length === 0) { + this.lendFormVisible = false + this.handleConfirmLend(params, this.lendSelections) + } else { + this.lendFormVisible = true + this.table.forEach(item => { + item.warnState = '未解除' + }) + this.n = 0 + } } }) }, diff --git a/src/views/archivesManage/lendManage/lendProcess/index.vue b/src/views/archivesManage/lendManage/lendProcess/index.vue index c39b211..3c9b6af 100644 --- a/src/views/archivesManage/lendManage/lendProcess/index.vue +++ b/src/views/archivesManage/lendManage/lendProcess/index.vue @@ -15,6 +15,7 @@ diff --git a/src/views/archivesManage/lendManage/lendQuery/module/archiveDetail.vue b/src/views/archivesManage/lendManage/lendQuery/module/archiveDetail.vue deleted file mode 100644 index 33ffa69..0000000 --- a/src/views/archivesManage/lendManage/lendQuery/module/archiveDetail.vue +++ /dev/null @@ -1,83 +0,0 @@ - - - - - diff --git a/src/views/archivesManage/lendManage/mixins/lending.js b/src/views/archivesManage/lendManage/mixins/lending.js index b4a057d..66183dd 100644 --- a/src/views/archivesManage/lendManage/mixins/lending.js +++ b/src/views/archivesManage/lendManage/mixins/lending.js @@ -1,4 +1,5 @@ import { FetchInitBorrowRule, FetchBillBorrowConfirm, FetchArchivesReturnConfirm } from '@/api/archivesManage/lendManage' +import { FetchFindAllSubsetById } from '@/api/archivesConfig/dictDetail' export const lendingCrud = { filters: { borrowStatus(val) { @@ -11,6 +12,8 @@ export const lendingCrud = { return '待归还' case 4: return '已归还' + case 5: + return '逾期' } }, tidType(val) { @@ -24,14 +27,52 @@ export const lendingCrud = { } } }, + // 组件共用属性 data() { return { - lineStateVal: '' + lineStateVal: '', + lendQuery: {}, + lendSelect: '', + isTrue: false + } + }, + // 组件挂载时的共用方法 + mounted() { + if (this.queryOption) { + this.lendSelect = this.queryOption[0].value } }, // 组件共用方法 methods: { + borrowStyle(val) { + console.log(val) + switch (val) { + case '逾期': + return 'cell-lend have-lend' + case '已归还': + return 'cell-lend has-return' + default: + return 'cell-lend no-lend ' + } + }, + getDepart() { + FetchFindAllSubsetById({ id: 'BA3910917510B181160A9A' }).then(data => { + this.departOptions = data + }) + }, + selectionChangeHandler(val) { + this.selections = val + }, + // 档案详情 + handleDbClick(row) { + this.$nextTick(() => { + const archiveDetailDom = this.$refs.archiveDetailDom + archiveDetailDom.detailVisible = true + archiveDetailDom.rowData = row + archiveDetailDom.getBillDetails() + }) + }, getBorrowRule() { FetchInitBorrowRule().then(data => { if (data) { @@ -56,9 +97,5 @@ export const lendingCrud = { } }) } - }, - // 组件挂载时的共用方法 - mounted() { - } } diff --git a/src/views/archivesManage/lendManage/returnArchives/index.vue b/src/views/archivesManage/lendManage/returnArchives/index.vue index 647d73e..44e8794 100644 --- a/src/views/archivesManage/lendManage/returnArchives/index.vue +++ b/src/views/archivesManage/lendManage/returnArchives/index.vue @@ -6,8 +6,8 @@ 导出
@@ -31,12 +31,12 @@ > - - + + - - - + + + - + - - + + + + @@ -63,12 +67,13 @@