Browse Source

档案管理-借阅/入库状态

master
xuhuajiao 3 years ago
parent
commit
7837a57c5a
  1. 32
      src/views/archivesManage/archivesList/archivesAnjuan/index.vue
  2. 6
      src/views/archivesManage/archivesList/archivesJuannei/index.vue
  3. 71
      src/views/archivesManage/archivesList/mixins/archives.js

32
src/views/archivesManage/archivesList/archivesAnjuan/index.vue

@ -101,6 +101,12 @@
{{ scope.row[field.fieldName] }} {{ scope.row[field.fieldName] }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="!recycleMain.isRecycle" label="标签" width="100" align="center" :fixed="fixedStatusBar ? false : 'right' ">
<template slot-scope="scope">
<!-- 未绑 / 已绑 -->
<span :class="['row-state', 'row-binding', scope.row.tid ? 'state-active' : '' ]">{{ scope.row.tid ? '已绑': '未绑' }}</span>
</template>
</el-table-column>
<el-table-column v-if="!recycleMain.isRecycle" label="装盒" width="100" align="center" :fixed="fixedStatusBar ? false : 'right' "> <el-table-column v-if="!recycleMain.isRecycle" label="装盒" width="100" align="center" :fixed="fixedStatusBar ? false : 'right' ">
<!-- state-active 已装/已入/已借/已绑 --> <!-- state-active 已装/已入/已借/已绑 -->
<template slot-scope="scope"> <template slot-scope="scope">
@ -109,23 +115,18 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="!recycleMain.isRecycle" label="入库" width="100" align="center" :fixed="fixedStatusBar ? false : 'right' "> <el-table-column v-if="!recycleMain.isRecycle" label="入库" width="100" align="center" :fixed="fixedStatusBar ? false : 'right' ">
<template slot-scope="">
<template slot-scope="scope">
<!-- is_storage 为空的情况下即没装盒 / 0 未入 / 1 待入 / 2 已入 / 3 待出--> <!-- is_storage 为空的情况下即没装盒 / 0 未入 / 1 待入 / 2 已入 / 3 待出-->
<span class="row-state row-warehousing">>{{ scope.row.is_storage | archivesStorageStatus }}</span>
<span class="row-state row-warehousing">{{ storageTxt[scope.$index] }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="!recycleMain.isRecycle" label="借阅" width="100" align="center" :fixed="fixedStatusBar ? false : 'right' "> <el-table-column v-if="!recycleMain.isRecycle" label="借阅" width="100" align="center" :fixed="fixedStatusBar ? false : 'right' ">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- is_borrow 4 已归还 / 为空 - 未加入待借列表 - 在库 / 2 待借阅在待借列表/借出确认列表 - 待借 / 1待登记 - 不可借- 表示 / 3 待归还 - 已借 --> <!-- is_borrow 4 已归还 / 为空 - 未加入待借列表 - 在库 / 2 待借阅在待借列表/借出确认列表 - 待借 / 1待登记 - 不可借- 表示 / 3 待归还 - 已借 -->
<span class="row-state row-lending">{{ scope.row.is_borrow | archivesborrowStatus }}</span>
</template>
</el-table-column>
<el-table-column v-if="!recycleMain.isRecycle" label="标签" width="100" align="center" :fixed="fixedStatusBar ? false : 'right' ">
<template slot-scope="scope">
<!-- 未绑 / 已绑 -->
<span :class="['row-state', 'row-binding', scope.row.tid ? 'state-active' : '' ]">{{ scope.row.tid ? '已绑': '未绑' }}</span>
<span class="row-state row-lending">{{ borrowTxt[scope.$index] }}</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<!--分页组件--> <!--分页组件-->
<el-pagination <el-pagination
@ -368,12 +369,24 @@ export default {
}, },
// //
handleLending() { handleLending() {
const index = this.selections.findIndex((item) => item.is_storage === 0 || item.is_storage === '' || item.is_storage === 1)
const index2 = this.selections.findIndex((item) => item.is_borrow === 3)
if (index !== -1) {
this.$message.error('所选档案还未入库不能借阅')
return false
}
if (index2 !== -1) {
this.$message.error('当前档案已借出,还未归还')
return false
}
const params = this.selections.map(item => { const params = this.selections.map(item => {
return item.id return item.id
}) })
FetchIsExistBorrow(params).then(data => { FetchIsExistBorrow(params).then(data => {
if (data.length === 0) { if (data.length === 0) {
this.lengingVisible = true this.lengingVisible = true
} else if (data.length === this.selections.length) {
this.$message.error('所选档案不可借阅')
} else { } else {
this.$message.error('部分档案不可借阅') this.$message.error('部分档案不可借阅')
} }
@ -388,6 +401,7 @@ export default {
if (data.length !== 0) { if (data.length !== 0) {
this.$message.success('借阅成功') this.$message.success('借阅成功')
this.lengingVisible = false this.lengingVisible = false
this.crud.refresh()
} }
}) })
} }

6
src/views/archivesManage/archivesList/archivesJuannei/index.vue

@ -92,9 +92,9 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="!recycleMain.isRecycle" label="入库" width="100" align="center" :fixed="fixedStatusBar ? false : 'right' "> <el-table-column v-if="!recycleMain.isRecycle" label="入库" width="100" align="center" :fixed="fixedStatusBar ? false : 'right' ">
<template slot-scope="">
<!-- 未入 / 已入 -->
<span class="row-state row-warehousing">未入</span>
<template slot-scope="scope">
<!-- is_storage 为空的情况下即没装盒 / 0 未入 / 1 待入 / 2 已入 / 3 待出-->
<span class="row-state row-warehousing">{{ storageTxt[scope.$index] }}</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>

71
src/views/archivesManage/archivesList/mixins/archives.js

@ -4,17 +4,27 @@ import { FetchTableDisplayFields, FetchInitArchivesView, FetchFormDisplayFields
export const archivesCrud = { export const archivesCrud = {
filters: { filters: {
archivesborrowStatus(val) { archivesborrowStatus(val) {
switch (val) {
case 1:
return '-'
case 2:
return '待借'
case 3:
return '已借'
case 4:
return '在库'
case '':
return '在库'
// switch (val) {
// case 1:
// return '-'
// case 2:
// return '待借'
// case 3:
// return '已借'
// case 4:
// return '在库'
// case '':
// return '-'
// }
if (val === 1) {
return '-'
} else if (val === 2) {
return '待借'
} else if (val === 3) {
return '已借'
} else if (val === '') {
return '-'
} }
}, },
archivesStorageStatus(val) { archivesStorageStatus(val) {
@ -62,6 +72,8 @@ export const archivesCrud = {
{ key: '5', label: '待借' }, { key: '5', label: '待借' },
{ key: '6', label: '已借' } { key: '6', label: '已借' }
], ],
storageTxt: [],
borrowTxt: [],
tableDisplayFields: [], // table-list-title字段 tableDisplayFields: [], // table-list-title字段
getTableDisplayFieldsLoading: false, // table-loading getTableDisplayFieldsLoading: false, // table-loading
formVisible: false, formVisible: false,
@ -187,6 +199,43 @@ export const archivesCrud = {
this[name] = data.list.content this[name] = data.list.content
this.yearGroup = data.yearGroup this.yearGroup = data.yearGroup
this.page.total = data.list.totalElements this.page.total = data.list.totalElements
if (name === 'anjuanData' || name === 'junneiData') {
this[name].forEach((item, index) => {
// 入库状态
if (item.is_storage === 0) {
this.storageTxt[index] = '未入'
if (item.is_borrow === '') {
this.borrowTxt[index] = '-'
}
} else if (item.is_storage === 1) {
this.storageTxt[index] = '待入'
if (item.is_borrow === '') {
this.borrowTxt[index] = '-'
}
} else if (item.is_storage === 2) {
this.storageTxt[index] = '已入'
if (item.is_borrow === '') {
this.borrowTxt[index] = '在库'
}
} else if (item.is_storage === 3) {
this.storageTxt[index] = '待出'
} else if (item.is_storage === '') {
this.storageTxt[index] = '未入'
if (item.is_borrow === '') {
this.borrowTxt[index] = '-'
}
}
// 借阅状态
if (item.is_borrow === 1) {
this.borrowTxt[index] = '待借'
} else if (item.is_borrow === 2) {
this.borrowTxt[index] = '待借'
} else if (item.is_borrow === 3) {
this.borrowTxt[index] = '已借'
}
})
}
} }
}) })
}, },

Loading…
Cancel
Save