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

253 lines
7.2 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. <template>
  2. <div>
  3. <el-dialog ref="dialogTable" title="新增盘点" :visible.sync="addFormVisible" class="dialog-table">
  4. <span class="dialog-right-top" />
  5. <span class="dialog-left-bottom" />
  6. <div class="setting-dialog">
  7. <el-form
  8. ref="form"
  9. :model="checkForm"
  10. size="small"
  11. label-width="80px"
  12. >
  13. <el-form-item label="选择区域" prop="selectArea" class="down-select" style="padding-top:1px">
  14. <treeselect
  15. v-model="selectAreaValue"
  16. :options="selectArea"
  17. multiple
  18. placeholder="请选择"
  19. style="width:245px;height:30px"
  20. :limit="2"
  21. :limit-text="count => `+${count}`"
  22. />
  23. </el-form-item>
  24. <el-form-item label="选择门类" prop="category" class="down-select">
  25. <el-select
  26. v-model="categoryValue"
  27. style="width: 245px;"
  28. multiple
  29. filterable
  30. clearable
  31. placeholder="请选择"
  32. :collapse-tags="showTags"
  33. @change="selectChange"
  34. >
  35. <el-option
  36. v-for="item in category"
  37. :key="item.value"
  38. :label="item.label"
  39. :value="item.value"
  40. />
  41. </el-select>
  42. </el-form-item>
  43. <el-button type="primary" size="mini" style="margin:0 0 0 10px;height:30px" @click="handleBuild">生成盘点单</el-button>
  44. </el-form>
  45. <el-table :data="tableData" height="calc(100vh - 595px)" :cell-class-name="cell">
  46. <el-table-column type="index" align="center" label="序号" width="80" />
  47. <el-table-column prop="checkState" align="center" label="状态" width="120">
  48. <template slot-scope="scope">
  49. <!-- 已执行 / 待执行/执行中 -->
  50. <span class="clear">{{ scope.row.checkState }}</span>
  51. </template>
  52. </el-table-column>
  53. <el-table-column prop="" align="center" label="门类级别" width="100" />
  54. <el-table-column prop="" align="center" label="门类名称" width="120" />
  55. <el-table-column prop="" align="center" label="全宗号" width="100" />
  56. <el-table-column prop="" align="center" label="档号" width="180" />
  57. <el-table-column prop="" align="center" label="归档年度" width="100" />
  58. <el-table-column prop="" label="题名" align="center" width="180" />
  59. <el-table-column prop="" label="保密程度" align="center" width="85" />
  60. <el-table-column prop="" label="部门" align="center" width="120" />
  61. <el-table-column prop="" label="盒名称" align="center" width="85" />
  62. <el-table-column prop="" label="所在位置" align="center" width="150" />
  63. <el-table-column prop="" label="创建时间" align="center" width="150" />
  64. </el-table>
  65. <!-- 分页器 记得加上!!!!!!!!!!!!!!!!!!!!!! -->
  66. <!-- !!!!!!!!!!!!!!!!!!!!!!!! -->
  67. <div slot="footer" class="dialog-footer">
  68. <el-button @click="handleSave">保存</el-button>
  69. </div>
  70. </div>
  71. </el-dialog>
  72. </div>
  73. </template>
  74. <script>
  75. import Treeselect from '@riophae/vue-treeselect'
  76. import '@riophae/vue-treeselect/dist/vue-treeselect.css'
  77. var menus = [
  78. {
  79. id: 1,
  80. label: '父区域',
  81. children: [
  82. // {
  83. // id: 100,
  84. // label: '子区域1',
  85. // children: [
  86. {
  87. id: 1000,
  88. label: '设备1.1'
  89. },
  90. {
  91. id: 1001,
  92. label: '设备1.2'
  93. },
  94. {
  95. id: 1002,
  96. label: '设备1.3'
  97. },
  98. {
  99. id: 1003,
  100. label: '设备1.4'
  101. }
  102. ]
  103. },
  104. {
  105. id: 101,
  106. label: '子区域2',
  107. children: [
  108. {
  109. id: 1006,
  110. label: '设备2.1'
  111. },
  112. {
  113. id: 1007,
  114. label: '设备2.2'
  115. },
  116. {
  117. id: 1008,
  118. label: '设备2.3'
  119. },
  120. {
  121. id: 1011,
  122. label: '设备2.4'
  123. }
  124. ]
  125. }
  126. // ]
  127. // }
  128. ]
  129. export default {
  130. components: { Treeselect },
  131. data() {
  132. return {
  133. menusIds: [],
  134. tableData: [],
  135. checkForm: {},
  136. addFormVisible: false,
  137. selectAreaValue: [],
  138. selectArea: menus,
  139. defaultProps: { children: 'children', label: 'label' },
  140. nodeKey: 'id',
  141. defaultCheckedKeys: [],
  142. categoryValue: [0, 1, 2, 3],
  143. oldCategory: [0, 1, 2, 3],
  144. category: [
  145. { value: 0, label: '全部' },
  146. { value: 1, label: '档号' },
  147. { value: 2, label: '题名' },
  148. { value: 3, label: '位置' }
  149. ],
  150. showTags: true
  151. }
  152. },
  153. methods: {
  154. handleBuild() {
  155. console.log(this.$refs.dialogTable.$refs)
  156. },
  157. handleSave() {
  158. this.addFormVisible = false
  159. },
  160. // 选择门类
  161. selectChange(val) {
  162. // console.log(val)
  163. if (val[val.length - 1] === 0) { // 选择全选
  164. this.categoryValue = [0, 1, 2, 3]
  165. this.showTags = true
  166. } else {
  167. const arr1 = this.oldCategory.filter(item => item !== 0)
  168. const arr2 = val.filter(item => item !== 0)
  169. if (arr1.length === arr2.length) { // 取消全选
  170. this.categoryValue = []
  171. } else if (arr1.length < arr2.length && arr2.length === this.category.length - 1) {
  172. this.categoryValue.unshift(0) // 除全选时都选中 此时加入全选
  173. this.showTags = true
  174. } else {
  175. this.categoryValue = this.categoryValue.filter(item => item !== 0) // 取消其他选项时 去除全选
  176. this.showTags = false
  177. }
  178. }
  179. this.oldCategory = this.categoryValue
  180. },
  181. // 单元格样式
  182. cell({ row, columnIndex }) {
  183. if (columnIndex === 1) {
  184. return 'fail-clear'
  185. }
  186. }
  187. }
  188. }
  189. </script>
  190. <style lang="scss" scoped>
  191. @import '~@/assets/styles/lend-manage.scss';
  192. .el-form{
  193. display: flex;
  194. padding-left: 12px;
  195. }
  196. ::v-deep .el-dialog{
  197. width: 950px;
  198. height: 520px;
  199. }
  200. ::v-deep .el-dialog .el-dialog__header .el-dialog__close::before{
  201. position: absolute;
  202. right: -160px;
  203. bottom: -12px;
  204. }
  205. ::v-deep .el-dialog__body{
  206. padding: 30px 0;
  207. }
  208. ::v-deep .el-tag.el-tag--info{
  209. height: 26px;
  210. line-height: 26px;
  211. background-color: #13439E;
  212. border: none;
  213. color: #fff;
  214. }
  215. ::v-deep .el-tag.el-tag--info .el-tag__close{
  216. background-color: #fff;
  217. }
  218. ::v-deep .el-input__inner{
  219. height: 30px !important;
  220. }
  221. //滚动条
  222. ::v-deep ::-webkit-scrollbar-corner{
  223. background: transparent;
  224. }
  225. // 树形选择器
  226. ::v-deep .vue-treeselect--has-value .vue-treeselect__multi-value{
  227. margin-bottom: 0;
  228. }
  229. ::v-deep .vue-treeselect__multi-value-item-container{
  230. padding-top: 2px;
  231. line-height: 20px;
  232. }
  233. ::v-deep .el-dialog .el-form .vue-treeselect__control{
  234. line-height: 18px;
  235. }
  236. ::v-deep .vue-treeselect__limit-tip{
  237. background: #13439E;
  238. border-radius: 3px;
  239. margin: 2px;
  240. padding: 0 3px;
  241. .vue-treeselect__limit-tip-text{
  242. padding: 2px 2px;
  243. color: #fff;
  244. }
  245. }
  246. </style>