WarehousingDetails.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <template>
  2. <el-card v-loading="loadingStatus" element-loading-text="生成Excel文件中,请稍后" element-loading-background="rgba(0, 0, 0, 0.2)">
  3. <el-table :data="tableList" :cell-style="{ padding: '0' }" :row-style="{ height: '35px' }" v-loading="loading" header-row-class-name="tableHeader">
  4. <el-table-column label="出入库单号" prop="code" width="180" />
  5. <el-table-column label="采购单号" prop="purchaseCode" width="160" />
  6. <el-table-column label="归属事业部" width="140">
  7. <template slot-scope="scope">
  8. <span v-if="scope.row.subsidiaryName">{{ scope.row.subsidiaryName }}</span>
  9. <span v-else>胜德体育</span>
  10. </template>
  11. </el-table-column>
  12. <el-table-column label="仓库类型" width="120">
  13. <template slot-scope="scope">
  14. <span>{{ getWarehouseName(scope.row.warehouseId) }}</span>
  15. </template>
  16. </el-table-column>
  17. <el-table-column label="仓库" prop="warehouseName" width="120" />
  18. <el-table-column label="出入库类型" width="120" :formatter="statusFormat" />
  19. <el-table-column label="品号" prop="colorCode" width="120" />
  20. <el-table-column label="品名" prop="colorName" min-width="300" />
  21. <el-table-column label="数量" width="120">
  22. <template slot-scope="scope">
  23. <span v-if="scope.row.quantity">{{ Number(scope.row.quantity) }}</span>
  24. </template>
  25. </el-table-column>
  26. <el-table-column label="出入库时间" align="center" prop="createTime" width="140" />
  27. <el-table-column label="出入库申请人" prop="proposer" width="120" />
  28. </el-table>
  29. <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
  30. </el-card>
  31. </template>
  32. <script>
  33. import * as API from '@/api/shengde/warehouse/outAndInWarehouse'
  34. import { mapGetters } from 'vuex'
  35. import { warehouseList } from '@/api/shengde/warehouse/management'
  36. import { getList } from '@/api/shengde/group/subcompany/subcompanyManagement/index.js'
  37. export default {
  38. props: {
  39. rowData: Object,
  40. },
  41. data() {
  42. return {
  43. queryParams: {
  44. pageNum: 1,
  45. pageSize: 10,
  46. subsidiaryId: '',
  47. warehouseName: '',
  48. code: '',
  49. type: '',
  50. strTime: '',
  51. endTime: '',
  52. colorCode: '',
  53. colorName: '',
  54. purchaseCode: '',
  55. },
  56. loading: false,
  57. tableList: [],
  58. total: 0,
  59. warehouseList: [],
  60. stockType: [],
  61. stockTypeTwo: [],
  62. companyList: [{ id: '0', name: '胜德体育' }],
  63. pwd: '',
  64. openCheckPWD: false,
  65. loadingStatus: false,
  66. }
  67. },
  68. created() {
  69. if (this.rowData && this.rowData.purchaseCode) {
  70. this.queryParams.purchaseCode = this.rowData.purchaseCode
  71. }
  72. this.stockType = this.dictData.filter((item) => item.code === 'put_stock_type')[0].children
  73. this.stockTypeTwo = this.dictData.filter((item) => item.code === 'come_stock_type')[0].children
  74. warehouseList({ pageNum: 1, pageSize: 9999 }).then((res) => {
  75. this.warehouseList = res.data.data.list
  76. this.loading = false
  77. })
  78. getList({ pageNum: 1, pageSize: 9999 }).then((res) => {
  79. this.companyList = this.companyList.concat(res.data.data.records)
  80. })
  81. },
  82. mounted() {
  83. this.getList()
  84. },
  85. computed: mapGetters(['dictData']),
  86. methods: {
  87. getList() {
  88. this.loading = true
  89. API.purchaseDetailsList(this.queryParams).then(
  90. (res) => {
  91. this.tableList = res.data.data.list
  92. this.loading = false
  93. },
  94. (err) => {
  95. console.log('purchaseDetailsList: ' + err)
  96. this.loading = false
  97. }
  98. )
  99. API.purchaseDetailsListCount(this.queryParams).then((res) => {
  100. this.total = res.data.data.count
  101. })
  102. },
  103. /** 搜索按钮操作 */
  104. handleQuery() {
  105. this.queryParams.pageNum = 1
  106. this.getList()
  107. },
  108. /** 重置按钮操作 */
  109. resetQuery() {
  110. this.resetForm('queryForm')
  111. this.queryParams.strTime = ''
  112. this.queryParams.endTime = ''
  113. this.handleQuery()
  114. },
  115. getWarehouseName(id) {
  116. if (this.warehouseList && this.warehouseList.length > 0 && id) {
  117. let data = this.warehouseList.filter((item) => item.id === id)
  118. if (data && data.length > 0) {
  119. return data[0].name
  120. }
  121. }
  122. return ''
  123. },
  124. statusFormat(row) {
  125. if (row.type) {
  126. if (row.status === 1) {
  127. return this.selectConstantsLabel(this.stockType, row.type + '')
  128. } else {
  129. return this.selectConstantsLabel(this.stockTypeTwo, row.type + '')
  130. }
  131. } else {
  132. return ''
  133. }
  134. },
  135. },
  136. }
  137. </script>
  138. <style lang="scss" scoped>
  139. * {
  140. font-size: 12px;
  141. }
  142. ::v-deep {
  143. .el-input__inner {
  144. border-radius: 1px;
  145. }
  146. .el-button--mini {
  147. border-radius: 1px;
  148. }
  149. .tableHeader th {
  150. background-color: #edf0f5;
  151. height: 35px;
  152. padding: 0;
  153. }
  154. }
  155. </style>