【前端】智能库房综合管理系统前端项目
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.

160 lines
6.0 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. <template>
  2. <div class="app-container">
  3. <binding-tag-dlg ref="bindingTag" :binding-id="crud.selections[0] && crud.selections[0].id" :binding-type="3" binding-txt="层架位" @refresh="crud.refresh" />
  4. <div class="head-container">
  5. <p class="warning">
  6. <svg-icon icon-class="warning" />
  7. <span>温馨提示如需配置层位请直接前往库房设备管理进行设备维护</span>
  8. </p>
  9. <div>
  10. <el-button type="primary" class="iconfont icon-jiechubangding-fanbai" size="mini" :disabled="crud.selections.length !== 1" @click="bindingTag(crud.selections)">绑定标签</el-button>
  11. </div>
  12. </div>
  13. <el-row class="container-main">
  14. <el-col class="curd-in-out" :xs="10" :sm="8" :md="5" :lg="6" :xl="5">
  15. <div class="container-left left-tree-item" style="height:calc(100vh - 240px)">
  16. <span class="right-top-line" />
  17. <span class="left-bottom-line" />
  18. <!--树状结构-->
  19. <device-tree @nodeClick="handleNodeClick" />
  20. </div>
  21. </el-col>
  22. <!-- 档案管理列表 -->
  23. <el-col class="container-right" style="min-height: calc(100vh - 240px);" :xs="14" :sm="18" :md="19" :lg="18" :xl="19">
  24. <span class="right-top-line" />
  25. <span class="left-bottom-line" />
  26. <!--表格渲染-->
  27. <el-table ref="table" v-loading="crud.loading" :data="crud.data" highlight-current-row style="width: 100%;" height="calc(100vh - 295px)" @selection-change="selectionChangeHandler" @row-click="clickRowHandler">
  28. <el-table-column align="center" type="selection" width="55" />
  29. <el-table-column align="center" type="index" label="序号" width="55" />
  30. <!-- <el-table-column align="center" label="库房">
  31. <template>
  32. {{ storeroomName }}
  33. </template>
  34. </el-table-column> -->
  35. <el-table-column align="center" prop="position_name" label="层位名称" />
  36. <el-table-column align="center" prop="position" label="层位编号" />
  37. <el-table-column align="center" prop="storeroomCode" label="库房代码" />
  38. <el-table-column v-if="deviceInfo.deviceTypeId && deviceInfo.deviceTypeId.name === '密集架'" align="center" prop="areaNo" label="区号" width="80" />
  39. <el-table-column v-if="deviceInfo.deviceTypeId && deviceInfo.deviceTypeId.name === '回转柜'" align="center" prop="cupboardNo" label="柜号" width="80" />
  40. <el-table-column v-if="deviceInfo.deviceTypeId && deviceInfo.deviceTypeId.name === '密集架'" align="center" prop="columnRowNo" label="列号" width="80" />
  41. <el-table-column v-if="deviceInfo.deviceTypeId && deviceInfo.deviceTypeId.name === '密集架'" align="center" prop="partNo" label="节号" width="80" />
  42. <el-table-column align="center" prop="rowNo" label="层号" width="80" />
  43. <el-table-column v-if="deviceInfo.deviceTypeId && deviceInfo.deviceTypeId.name === '回转柜'" align="center" prop="columnRowNo" label="列号" width="80" />
  44. <el-table-column v-if="deviceInfo.deviceTypeId && deviceInfo.deviceTypeId.name === '密集架'" align="center" prop="direction" label="方向" width="80" />
  45. <el-table-column align="center" prop="tid" label="标签" />
  46. <el-table-column align="center" prop="update_time" label="操作时间" width="150">
  47. <template slot-scope="scope">
  48. <div>{{ scope.row.update_time | parseTime }}</div>
  49. </template>
  50. </el-table-column>
  51. </el-table>
  52. <!--分页组件-->
  53. <pagination />
  54. </el-col>
  55. </el-row>
  56. </div>
  57. </template>
  58. <script>
  59. import DeviceTree from '@/views/components/DeviceTree'
  60. import BindingTagDlg from '@/views/components/BindingTagDlg'
  61. import CRUD, { presenter } from '@crud/crud'
  62. import pagination from '@crud/Pagination'
  63. export default {
  64. name: 'LevelManage',
  65. components: { DeviceTree, pagination, BindingTagDlg },
  66. mixins: [presenter()],
  67. cruds() {
  68. return [
  69. CRUD({
  70. url: 'api/tag/list',
  71. queryOnPresenterCreated: false,
  72. sort: ['areaNo,asc', 'columnRowNo,asc', 'partNo,asc', 'rowNo,asc', 'position,asc']
  73. })
  74. ]
  75. },
  76. data() {
  77. return {
  78. deviceInfo: {},
  79. storeroomName: ''
  80. }
  81. },
  82. created() {
  83. },
  84. methods: {
  85. [CRUD.HOOK.beforeRefresh]() {
  86. this.crud.query.deviceInfoId = this.deviceInfo.id
  87. },
  88. handleNodeClick(data) {
  89. this.deviceInfo = data
  90. this.crud.toQuery()
  91. this.storeroomName = data.storeroomId.name
  92. },
  93. // 参数绑定
  94. handleBindParam() {
  95. },
  96. clickRowHandler(row) {
  97. this.$refs.table.clearSelection()
  98. this.$refs.table.toggleRowSelection(row)
  99. },
  100. selectionChangeHandler(val) {
  101. if (val.length > 1) {
  102. // 取出最后val的最后一个返回出来
  103. const finalVal = val.pop()
  104. // 清除所有选中
  105. this.$refs.table.clearSelection()
  106. // 给最后一个加上选中
  107. this.$refs.table.toggleRowSelection(finalVal)
  108. this.crud.selectionChangeHandler([finalVal])
  109. } else {
  110. this.crud.selectionChangeHandler(val)
  111. }
  112. },
  113. bindingTag(data) {
  114. if (data[0].tid) {
  115. this.$refs.bindingTag.isBinding = true
  116. this.$refs.bindingTag.tidCode = data[0].tid
  117. }
  118. this.$refs.bindingTag.bindingVisible = true
  119. }
  120. }
  121. }
  122. </script>
  123. <style lang="scss" scoped>
  124. .head-container {
  125. display: flex;
  126. justify-content: space-between;
  127. align-items: center;
  128. .el-button {
  129. width: 106px;
  130. height: 30px;
  131. background-color: #1aae93;
  132. border: none;
  133. &:disabled {
  134. background-color: #0D5649;
  135. color: #666;
  136. }
  137. &::before {
  138. padding-right: 5px;
  139. }
  140. }
  141. }
  142. ::v-deep .el-icon-more:before {
  143. margin-right: 8px;
  144. }
  145. .app-container {
  146. margin-top: 0;
  147. }
  148. .warning {
  149. font-size: 14px;
  150. color: #3a99fd;
  151. span {
  152. margin-left: 5px;
  153. }
  154. }
  155. ::v-deep thead .el-table-column--selection .cell {
  156. display: none;
  157. }
  158. </style>