黄陂项目
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.

269 lines
9.0 KiB

2 months ago
2 months ago
2 months ago
  1. <template>
  2. <div class="lendComfirm-arcList">
  3. <el-button class="exception-btn" size="mini" :disabled="!selections.length" @click="handleBorrowException"><svg-icon icon-class="exception" class-name="lend-handle" />异常处理</el-button>
  4. <div class="container-wrap">
  5. <span class="right-top-line" />
  6. <span class="left-bottom-line" />
  7. <!--表格渲染-->
  8. <el-table
  9. ref="table"
  10. v-loading="tableLoading"
  11. :data="tableData"
  12. style="min-width: 100%"
  13. @selection-change="selectionChangeHandler"
  14. @row-click="clickRowHandler"
  15. >
  16. <el-table-column type="selection" align="center" width="55" />
  17. <el-table-column type="index" label="序号" align="center" width="55" />
  18. <el-table-column prop="categoryName" align="center" label="门类名称" min-width="120" show-overflow-tooltip />
  19. <el-table-column prop="archiveNo" align="center" label="档号" min-width="160" show-overflow-tooltip />
  20. <el-table-column prop="maintitle" align="center" label="题名" min-width="180" show-overflow-tooltip />
  21. <el-table-column prop="caseName" align="center" label="盒名称" min-width="100" show-overflow-tooltip />
  22. <el-table-column prop="folderLocationDetails" align="center" label="存放位置" min-width="300">
  23. <template slot-scope="scope">
  24. <div v-if="scope.row.folderLocationDetails.includes(',')">
  25. <el-tag
  26. v-for="(item,index) in scope.row.folderLocationDetails.split(',')"
  27. :key="index"
  28. :type="item"
  29. effect="dark"
  30. >
  31. {{ item }}
  32. </el-tag>
  33. </div>
  34. <div v-else>
  35. <el-tag effect="dark">{{ scope.row.folderLocationDetails }}</el-tag>
  36. </div>
  37. </template>
  38. </el-table-column>
  39. <el-table-column prop="borrowType" align="center" label="借阅状态" min-width="100">
  40. <template slot-scope="scope">
  41. <!-- 待借阅 -->
  42. <span :class="borrowStyle(scope.row.borrowType)" style="width:76px">{{ scope.row.borrowType | borrowStatus }}</span>
  43. </template>
  44. </el-table-column>
  45. <el-table-column prop="borrowType" align="center" label="开架操作" min-width="80">
  46. <template slot-scope="scope">
  47. <el-button v-if="scope.row.folderLocationDetails" size="mini" type="primary" @click="openCol(scope.row.folderLocationDetails)">开架</el-button>
  48. </template>
  49. </el-table-column>
  50. <el-table-column prop="createTime" align="center" label="操作时间" min-width="130">
  51. <template slot-scope="scope">
  52. <div>{{ scope.row.createTime | parseTime }}</div>
  53. </template>
  54. </el-table-column>
  55. </el-table>
  56. </div>
  57. <!-- 异常处理 -->
  58. <el-dialog title="异常处理" :visible.sync="exceptionVisible" :close-on-click-modal="false" :before-close="handleClose">
  59. <span class="dialog-right-top" />
  60. <span class="dialog-left-bottom" />
  61. <div class="setting-dialog">
  62. <div class="dialog-delt">
  63. <p><span>确定当前档案存在异常情况</span></p>
  64. </div>
  65. <div slot="footer" class="dialog-footer">
  66. <el-button type="primary" @click.native="handleExceptionConfirm">确定</el-button>
  67. </div>
  68. </div>
  69. </el-dialog>
  70. <!-- 是否查看视频监控 -->
  71. <el-dialog title="提示" :visible.sync="videoTipVisible" :close-on-click-modal="false" :before-close="handleClose">
  72. <span class="dialog-right-top" />
  73. <span class="dialog-left-bottom" />
  74. <div class="setting-dialog">
  75. <div class="dialog-delt">
  76. <p><span>是否需要查看相关视频监控</span></p>
  77. </div>
  78. <div slot="footer" class="dialog-footer">
  79. <el-button type="primary" @click.native="handleLookVideo">确定</el-button>
  80. </div>
  81. </div>
  82. </el-dialog>
  83. <!-- 摄像头视频 -->
  84. <Video ref="camera" :dialog-open.sync="open" :camera-data="cameraData" />
  85. </div>
  86. </template>
  87. <script>
  88. import { FetchInitArchivesByOrderNo, FetchBorrowException } from '@/api/archivesManage/lendManage'
  89. import { lendingCrud } from '../mixins/lending'
  90. import CallExternal from '@/api/storeManage/deviceManage/device'
  91. import Video from './video'
  92. import displayConfigApi from '@/api/storeManage/displayConfig'
  93. export default {
  94. name: 'LendArchivesList',
  95. components: { Video },
  96. mixins: [lendingCrud],
  97. props: {
  98. archivesOrderNum: {
  99. type: String,
  100. default: function() {
  101. return ''
  102. }
  103. }
  104. },
  105. data() {
  106. return {
  107. selections: [],
  108. tableData: [],
  109. tableLoading: false,
  110. exceptionVisible: false,
  111. deviceData: null,
  112. videoTipVisible: false,
  113. camConfigData: [],
  114. cameraData: [],
  115. open: false
  116. }
  117. },
  118. watch: {
  119. archivesOrderNum: function(newValue, oldValue) {
  120. if (newValue) {
  121. this.getArchivesTable()
  122. }
  123. }
  124. },
  125. created() {
  126. displayConfigApi.list({ storeroomId: 'D6490DA3D4261E8C26D0E3' }).then((data) => {
  127. if (data) {
  128. this.camConfigData = data
  129. }
  130. })
  131. },
  132. mounted() {
  133. this.getArchivesTable()
  134. },
  135. methods: {
  136. // 档案异常处理
  137. handleBorrowException() {
  138. const index = this.selections.findIndex(item => item.borrowType === -1)
  139. if (index === -1) {
  140. this.exceptionVisible = true
  141. } else {
  142. this.$message.error('当前档案为异常状态,请勿重复操作!')
  143. return
  144. }
  145. },
  146. // 确认加入异常
  147. handleExceptionConfirm() {
  148. const params = this.selections.map(item => item.id)
  149. FetchBorrowException(params).then(data => {
  150. if (data === this.selections.length) {
  151. this.$message.success('已成功加入异常!')
  152. this.exceptionVisible = false
  153. this.getArchivesTable()
  154. }
  155. })
  156. },
  157. // 获取借阅确认下的档案list
  158. getArchivesTable() {
  159. this.tableLoading = true
  160. const params = {
  161. 'orderNo': this.archivesOrderNum
  162. }
  163. FetchInitArchivesByOrderNo(params).then(data => {
  164. if (data) {
  165. this.tableData = data
  166. this.tableLoading = false
  167. this.getDeviceListAll()
  168. }
  169. })
  170. },
  171. selectionChangeHandler(val) {
  172. this.selections = val
  173. },
  174. clickRowHandler(row) {
  175. this.$refs.table.toggleRowSelection(row)
  176. },
  177. handleClose(done) {
  178. this.exceptionVisible = false
  179. this.videoTipVisible = false
  180. done()
  181. },
  182. // 获取密集架相关信息
  183. getDeviceListAll() {
  184. const params = {
  185. sort: 'sequence,asc',
  186. storeroomId: 'D6490DA3D4261E8C26D0E3'
  187. }
  188. CallExternal.getDeviceList(params).then(data => {
  189. data.content.map(item => {
  190. if (item.deviceTypeId.name === '密集架') { // 写死状态
  191. this.deviceData = item
  192. }
  193. })
  194. })
  195. },
  196. // 开架
  197. openCol(data) {
  198. const loactionArray = data.split(' ')
  199. const location = data.split(' ')[loactionArray.length - 1]
  200. const pattern = /(\d+)区(\d+)列(\d+)节(\d+)层/
  201. const matches = location.match(pattern)
  202. let areaNumber
  203. let colNumber
  204. let leNumber
  205. let divNumber
  206. let zyNumber
  207. if (matches !== null) {
  208. areaNumber = matches[1]
  209. colNumber = matches[2]
  210. leNumber = matches[3]
  211. divNumber = matches[4]
  212. }
  213. const last_char = location.length - 1
  214. if (location[last_char] === '右') {
  215. zyNumber = '2'
  216. } else {
  217. zyNumber = '1'
  218. }
  219. const params = {
  220. deviceId: this.deviceData.id,
  221. quNo: areaNumber, // 区
  222. colNo: colNumber, // 列
  223. leNo: leNumber, // 节
  224. divNo: divNumber, // 层
  225. zyNo: zyNumber // 左右 1左 2右
  226. }
  227. CallExternal.FetchCallExternalOpenCol(params).then(res => {
  228. if (res.success && res.success === '0') {
  229. this.$message.success('开架执行成功')
  230. this.videoTipVisible = true
  231. } else {
  232. this.$message.error(res.msg)
  233. }
  234. }).catch((error) => {
  235. console.log(error)
  236. this.$message.error('连接失败')
  237. })
  238. },
  239. handleLookVideo() {
  240. this.videoTipVisible = false
  241. this.cameraData = this.camConfigData.filter((item) => { return item.divPosition.toLowerCase().includes('cam') })
  242. this.open = true
  243. this.$nextTick(() => {
  244. this.$refs.camera.camConfig = this.cameraData[0]
  245. this.$refs.camera.videoIndex = 0
  246. this.$refs.camera.play()
  247. })
  248. }
  249. }
  250. }
  251. </script>
  252. <style lang="scss" scoped>
  253. @import '~@/assets/styles/lend-manage.scss';
  254. .lendComfirm-arcList{
  255. .exception-btn{
  256. margin: 20px 0;
  257. .lend-handle{
  258. margin-right: 6px;
  259. }
  260. }
  261. .container-wrap{
  262. min-height: auto;
  263. }
  264. }
  265. </style>