图书馆综合管理系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

282 lines
11 KiB

7 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
7 months ago
7 months ago
6 months ago
6 months ago
7 months ago
6 months ago
6 months ago
6 months ago
7 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
7 months ago
6 months ago
7 months ago
6 months ago
7 months ago
  1. <template>
  2. <div class="app-container row-container">
  3. <div class="head-container">
  4. <div class="head-search">
  5. <!-- 搜索 -->
  6. <el-select v-model="selectFloorVal" size="small" placeholder="楼层" class="filter-item" style="width: 80px" value-key="id" @change="changeBeforeFloor">
  7. <el-option v-for="(item,index) in floorOptions" :key="index" :label="item.floorName" :value="item" />
  8. </el-select>
  9. <el-select v-model="selectRegionVal" size="small" placeholder="区域" class="filter-item" style="width: 140px" value-key="id" @change="changeBeforeRegion">
  10. <el-option v-for="(item,index) in regionOptions" :key="index" :label="item.regionName" :value="item" />
  11. </el-select>
  12. <el-input v-model="query.search" clearable size="small" placeholder="输入检索条件检索" prefix-icon="el-icon-search" style="width: 220px;" class="filter-item" @clear="crud.toQuery" @keyup.enter.native="crud.toQuery" />
  13. <rrOperation>
  14. <template v-slot:right>
  15. <el-button class="filter-item filter-refresh" size="mini" type="warning" icon="el-icon-refresh-left" @click="resetQuery()">重置</el-button>
  16. </template>
  17. </rrOperation>
  18. </div>
  19. <crudOperation :permission="permission">
  20. <template v-slot:right>
  21. <el-button size="mini" :loading="crud.delAllLoading" :disabled="crud.selections.length === 0" @click="handleRemoveShelf(crud.selections)">
  22. <i class="iconfont icon-chuku" />
  23. 一键下架
  24. </el-button>
  25. </template>
  26. </crudOperation>
  27. </div>
  28. <div class="container-wrap">
  29. <span class="right-top-line" />
  30. <span class="left-bottom-line" />
  31. <el-table
  32. ref="table"
  33. v-loading="crud.loading"
  34. class="archives-table"
  35. :data="crud.data"
  36. style="width: 100%;"
  37. height="calc(100vh - 329px)"
  38. @selection-change="crud.selectionChangeHandler"
  39. @row-click="clickRowHandler"
  40. >
  41. <el-table-column type="selection" align="center" width="55" />
  42. <el-table-column prop="gridName" label="层位名称" />
  43. <el-table-column prop="floorName" label="所属楼层" />
  44. <el-table-column prop="regionName" label="所属区域" />
  45. <el-table-column prop="isCheck" label="盘点开关" align="center">
  46. <template slot-scope="scope">
  47. <span v-if="scope.row.isCheck" class="row-state row-binding state-active">盘点开启</span>
  48. <span v-else class="row-state row-lending state-active">盘点关闭</span>
  49. </template>
  50. </el-table-column>
  51. <el-table-column prop="isOrder" label="有序检查" align="center">
  52. <template slot-scope="scope">
  53. <span v-if="scope.row.isOrder" class="row-state row-binding state-active"></span>
  54. <span v-else class="row-state row-lending state-active"></span>
  55. </template>
  56. </el-table-column>
  57. <el-table-column prop="startSortmark" label="索书号范围">
  58. <template slot-scope="scope">
  59. <span>{{ getSortmark(scope.row) }}</span>
  60. </template>
  61. </el-table-column>
  62. <el-table-column prop="deptsStatus" label="盘点概况" min-width="160">
  63. <template slot-scope="scope">
  64. <div class="tag-info">
  65. <p class="tag-sort">错序<i class="iconfont icon-zhuangtai2" />{{ scope.row.errorOrderNum }}</p>
  66. <p class="tag-place">错架<i class="iconfont icon-zhuangtai2" />{{ scope.row.errorShelfNum }}</p>
  67. <p class="tag-all">在架<i class="iconfont icon-zhuangtai2" />{{ scope.row.onShelfNum }}</p>
  68. </div>
  69. </template>
  70. </el-table-column>
  71. <el-table-column prop="createTime" label="操作">
  72. <template slot-scope="scope">
  73. <el-button @click="handlePosition(scope.row)">定位</el-button>
  74. </template>
  75. </el-table-column>
  76. </el-table>
  77. <!--分页组件-->
  78. <pagination v-if="crud.data.length!==0" />
  79. </div>
  80. <el-dialog class="positionDialog" append-to-body :close-on-click-modal="false" :modal-append-to-body="false" :before-close="handleCloseDialog" :visible="positionVisible" title="层位定位">
  81. <span class="dialog-right-top" />
  82. <span class="dialog-left-bottom" />
  83. <div class="setting-dialog">
  84. <ul class="book-detail">
  85. <li><span>所属机构</span>{{ user.fonds.fondsName }}</li>
  86. <li><span>所属楼层</span>{{ positionContent.floorName }}</li>
  87. <li><span>所属区域</span>{{ positionContent.regionName }}</li>
  88. <li><span>所属书架</span>{{ positionContent.gridName }}</li>
  89. </ul>
  90. <div class="position-content">
  91. <div class="position-left">
  92. <h5>平面图</h5>
  93. <div class="venue-preview">
  94. <div v-show="currentMarkData && currentMarkData.signPoint ">
  95. <canvas :id="`canvasPreview${currentMarkData && currentMarkData.id}`" :width="width" :height="height" />
  96. </div>
  97. <img v-if="currentMarkData && !currentMarkData.signPoint" :src="imageUrl" :onerror="defaultImg" alt="">
  98. <img v-if="!currentMarkData" :src="imageUrl" :onerror="defaultImg" alt="">
  99. </div>
  100. </div>
  101. <div class="position-right">
  102. <h5>书架图</h5>
  103. <div class="shelf-top" :style="rowStyle">
  104. <p v-for="(item,index) in reversedRackNum" :key="index" :style="{width: `calc(${'100%/' + rackNum} - 4px )`}"><span>{{ item + '架' }}</span></p>
  105. </div>
  106. <ul class="data-shelf-row" :style="rowStyle">
  107. <li
  108. v-for="(cell,i) in booShelfGrid"
  109. :key="i"
  110. :class="{ active: i === cellIndex }"
  111. class="data-shelf-cell"
  112. :style="cellStyle"
  113. >
  114. <span class="cell-name">{{ removeAreaPrefix(cell.gridName) }}</span>
  115. </li>
  116. </ul>
  117. </div>
  118. </div>
  119. </div>
  120. </el-dialog>
  121. </div>
  122. </template>
  123. <script>
  124. import { positionCrud } from '../positionMixins/index'
  125. import { FetchLibraryFloorListAll } from '@/api/floor/index'
  126. import { FetchInitLibraryRegionList } from '@/api/area/index'
  127. import crudShelf from '@/api/shelf/index'
  128. import CRUD, { presenter, header, crud } from '@crud/crud'
  129. import crudOperation from '@crud/CRUD.operation'
  130. import rrOperation from '@crud/RR.operation'
  131. import pagination from '@crud/Pagination'
  132. export default {
  133. name: 'BookSearch',
  134. components: { crudOperation, rrOperation, pagination },
  135. cruds() {
  136. return CRUD({ title: '架位检索', url: 'api/bookShelf/initShelfGridSearch', crudMethod: { ...crudShelf }, sort: [], optShow: {
  137. add: false,
  138. edit: false,
  139. del: false,
  140. download: false,
  141. group: false,
  142. reset: false
  143. }})
  144. },
  145. mixins: [presenter(), header(), crud(), positionCrud],
  146. data() {
  147. return {
  148. permission: {
  149. add: ['admin', 'search:add'],
  150. edit: ['admin', 'search:edit'],
  151. del: ['admin', 'search:del']
  152. },
  153. floorOptions: [],
  154. regionOptions: [],
  155. selectFloorVal: null,
  156. selectRegionVal: null
  157. }
  158. },
  159. async created() {
  160. this.getLibraryFloorListAll()
  161. },
  162. methods: {
  163. [CRUD.HOOK.beforeRefresh]() {
  164. },
  165. [CRUD.HOOK.afterRefresh](crud) {
  166. },
  167. // 提交前做的操作
  168. [CRUD.HOOK.afterValidateCU](crud) {
  169. return false
  170. },
  171. // 获取楼层数据
  172. getLibraryFloorListAll() {
  173. FetchLibraryFloorListAll().then(res => {
  174. this.floorOptions = res
  175. // if (this.floorOptions.length > 0) {
  176. // this.selectFloorVal = this.floorOptions[0]
  177. // this.crud.query.floorId = this.selectFloorVal.id
  178. // if (this.crud.query.floorId) {
  179. // this.getInitLibraryRegionList(this.crud.query.floorId)
  180. // }
  181. // }
  182. }).catch(() => {
  183. })
  184. },
  185. getInitLibraryRegionList(val) {
  186. const params = {
  187. 'floorId': val
  188. }
  189. FetchInitLibraryRegionList(params).then(res => {
  190. this.regionOptions = res.content
  191. // if (this.regionOptions.length > 0) {
  192. // this.selectRegionVal = this.regionOptions[0]
  193. // this.crud.query.regionId = this.selectRegionVal.id
  194. // } else {
  195. // this.selectRegionVal = null
  196. // this.crud.query.regionId = null
  197. // }
  198. this.crud.toQuery()
  199. }).catch(() => {
  200. })
  201. },
  202. changeBeforeFloor(val) {
  203. if (val) {
  204. this.selectFloorVal = val
  205. this.crud.query.floorId = val.id
  206. this.getInitLibraryRegionList(val.id)
  207. }
  208. },
  209. changeBeforeRegion(val) {
  210. if (val) {
  211. this.selectRegionVal = val
  212. this.crud.query.regionId = val.id
  213. this.crud.toQuery()
  214. }
  215. },
  216. resetQuery() {
  217. this.crud.query.search = ''
  218. this.selectFloorVal = null
  219. this.selectRegionVal = null
  220. this.crud.query.floorId = null
  221. this.crud.query.regionId = null
  222. this.crud.toQuery()
  223. },
  224. getSortmark(row) {
  225. const parts = []
  226. if (row.startSortmark) {
  227. parts.push(row.startSortmark)
  228. }
  229. if (row.endSortmark) {
  230. parts.push(row.endSortmark)
  231. }
  232. return parts.length > 0 ? parts.join('-') : '-'
  233. },
  234. clickRowHandler(row) {
  235. this.$refs.table.clearSelection()
  236. this.$refs.table.toggleRowSelection(row)
  237. },
  238. handleRemoveShelf(datas) {
  239. console.log(datas)
  240. this.crud.downloadLoading = true
  241. this.$confirm('此操作将下架所选层位的所有图书' + '<span>你是否还要继续?</span>', '提示', {
  242. confirmButtonText: '继续',
  243. cancelButtonText: '取消',
  244. type: 'warning',
  245. dangerouslyUseHTMLString: true
  246. }).then(() => {
  247. const ids = []
  248. datas.forEach(val => {
  249. ids.push(val.id)
  250. })
  251. console.log(ids)
  252. crudShelf.FetchFastDownShelf(ids).then((res) => {
  253. console.log(res)
  254. this.$message({ message: '一键下架操作成功', type: 'success', offset: 8 })
  255. this.crud.delAllLoading = false
  256. this.crud.refresh()
  257. }).catch(err => {
  258. this.crud.delAllLoading = false
  259. console.log(err)
  260. })
  261. }).catch(() => {
  262. this.crud.downloadLoading = false
  263. })
  264. }
  265. }
  266. }
  267. </script>
  268. <style lang="scss" scoped>
  269. .tag-info{
  270. p{
  271. margin-right: 20px;
  272. }
  273. }
  274. </style>