index.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" class="queryForm" size="small" :inline="true" label-width="68px">
  4. <el-form-item label="盘点部门" prop="inventoryDepartment">
  5. <treeselect v-model="queryParams.deptId" :options="deptOptions" placeholder="选择盘点部门" @keyup.enter.native="onQueryLoss" />
  6. </el-form-item>
  7. <el-form-item>
  8. <el-button type="primary" icon="el-icon-search" size="mini" @click="onQueryLoss">搜索</el-button>
  9. </el-form-item>
  10. </el-form>
  11. <el-row :gutter="10" class="mb8">
  12. <el-button type="warning" plain icon="el-icon-download" size="mini" @click="onLossExport" v-hasPermi="['inventory:inventory:export']">导出</el-button>
  13. </el-row>
  14. <el-table :data="lossList">
  15. <el-table-column type="expand">
  16. <template v-slot="slot">
  17. <el-table :data="slot.row.compareResultList" ref="table" :header-cell-style="{ background: '#dcdfe6' }">
  18. <el-table-column prop="assetName" label="资产名称"> </el-table-column>
  19. <el-table-column prop="location" label="资产位置"> </el-table-column>
  20. <el-table-column prop="category" label="类别"> </el-table-column>
  21. <el-table-column prop="nowQuantity" label="账面数量变化"> </el-table-column>
  22. <el-table-column prop="invQuantity" label="实点数量变化"> </el-table-column>
  23. <el-table-column prop="lossQuantity" label="损耗数量变化"> </el-table-column>
  24. <el-table-column prop="units" label="计量单位"> </el-table-column>
  25. <el-table-column prop="lossVal" label="损耗值变化"> </el-table-column>
  26. </el-table>
  27. </template>
  28. </el-table-column>
  29. <el-table-column prop="deptName" label="盘点部门"> </el-table-column>
  30. <el-table-column prop="lastSecondDate" label="最后第二次盘点日期"> </el-table-column>
  31. <el-table-column prop="lastFirstDate" label="最后盘点日期"> </el-table-column>
  32. </el-table>
  33. <!-- <pagination
  34. v-show="total>0"
  35. :total="total"
  36. :page.sync="queryParams.pageNum"
  37. :limit.sync="queryParams.pageSize"
  38. @pagination="onQueryLoss"
  39. /> -->
  40. </div>
  41. </template>
  42. <script>
  43. import { deptTreeSelect } from '@/api/system/user.js'
  44. import { getDepAssetLossTb } from '@/api/inventory/detail'
  45. import Treeselect from '@riophae/vue-treeselect'
  46. import '@riophae/vue-treeselect/dist/vue-treeselect.css'
  47. export default {
  48. components: {
  49. Treeselect,
  50. },
  51. data() {
  52. return {
  53. // 总条数
  54. total: 0,
  55. lossList: [],
  56. deptOptions: [],
  57. // 查询参数
  58. queryParams: {
  59. // pageNum: 1,
  60. // pageSize: 10,
  61. deptId: null,
  62. },
  63. }
  64. },
  65. created() {
  66. this.getDeptTree()
  67. },
  68. methods: {
  69. /** 查询部门下拉树结构 */
  70. getDeptTree() {
  71. deptTreeSelect().then((response) => {
  72. this.deptOptions = response.data
  73. this.queryParams.deptId = this.deptOptions[0].id
  74. this.onQueryLoss()
  75. })
  76. },
  77. onQueryLoss() {
  78. if (this.queryParams.deptId === null) {
  79. this.$modal.msgWarning('部门不能为空')
  80. return
  81. }
  82. getDepAssetLossTb(this.queryParams).then((response) => {
  83. this.lossList = response.data(
  84. // this.total = response.total;
  85. '资产报表',
  86. this.lossData
  87. )
  88. })
  89. },
  90. onLossExport() {
  91. if (this.queryParams.deptId === null) {
  92. this.$modal.msgWarning('部门不能为空')
  93. return
  94. }
  95. const deptId = this.queryParams.deptId
  96. this.download('inventory/inventory/exportDepAssetLossTb/' + deptId, {}, `资产报表_${new Date().getTime()}.xlsx`)
  97. this.openExport = false
  98. },
  99. },
  100. }
  101. </script>
  102. <style lang="less" scoped>
  103. /deep/ .vue-treeselect {
  104. display: inline-block;
  105. }
  106. .queryForm {
  107. /deep/ .vue-treeselect {
  108. width: 205px;
  109. height: 32px;
  110. }
  111. }
  112. .clickNumber {
  113. color: #409eff;
  114. &:hover {
  115. cursor: pointer;
  116. text-decoration: underline;
  117. }
  118. }
  119. </style>