adjust_warehouse.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <template>
  2. <div style="width: 100%; height: 100%; overflow-y: auto">
  3. <template-page
  4. v-show="!pageType"
  5. ref="pageRef"
  6. :getList="getList"
  7. :exportList="exportList"
  8. :operation="operation()"
  9. :columnParsing="columnParsing"
  10. :optionsEvensGroup="optionsEvensGroup"
  11. >
  12. </template-page>
  13. <warehouse-form v-if="pageType == 1" :pageType="pageType" @close="handleClose" />
  14. <warehouse-examine v-if="pageType == 2" :detailsId="detailsId" :pageType="pageType" @close="handleClose" />
  15. <warehouse-details v-if="pageType === 3" :detailsId="detailsId" :pageType="pageType" @close="handleClose" />
  16. </div>
  17. </template>
  18. <script>
  19. import popu from '@/components/template/popu.vue'
  20. import TemplatePage from '@/components/template/template-page-1.vue'
  21. import import_mixin from '@/components/template/import_mixin.js'
  22. import { getFrontListCustomerAcc, exportCustomerStockOrderBean, deleteCustomerStockOrder } from '@/api/stock'
  23. import WarehouseForm from '@/views/stock_control/components/WarehouseForm'
  24. import WarehouseExamine from '@/views/stock_control/components/WarehouseExamine'
  25. import WarehouseDetails from '@/views/stock_control/components/WarehouseDetails'
  26. export default {
  27. components: { TemplatePage, WarehouseForm, WarehouseExamine, WarehouseDetails, popu },
  28. mixins: [import_mixin],
  29. data() {
  30. return {
  31. // 事件组合
  32. optionsEvensGroup: [
  33. [
  34. [
  35. {
  36. name: '库存调整2',
  37. click: this.addWarehouse
  38. }
  39. ]
  40. ]
  41. ],
  42. // 表格属性
  43. tableAttributes: {
  44. // 启用勾选列
  45. selectColumn: true
  46. },
  47. // 表格事件
  48. tableEvents: {
  49. 'selection-change': this.selectionChange
  50. },
  51. recordSelected: [],
  52. detailsId: '',
  53. pageType: 0
  54. }
  55. },
  56. methods: {
  57. // 列表请求函数
  58. getList(...p) {
  59. this.recordSelected = []
  60. return getFrontListCustomerAcc(...p)
  61. },
  62. // 列表导出函数
  63. exportList: exportCustomerStockOrderBean,
  64. // 表格列解析渲染数据更改
  65. columnParsing(item, defaultData) {
  66. return defaultData
  67. },
  68. // 监听勾选变化
  69. selectionChange(data) {
  70. this.recordSelected = data
  71. },
  72. handleClose() {
  73. this.pageType = 0
  74. this.$refs.pageRef.refreshList()
  75. },
  76. addWarehouse() {
  77. this.pageType = 1
  78. console.log(this.pageType, '333')
  79. },
  80. operation() {
  81. return (h, { row, index, column }) => {
  82. return (
  83. <div class="operation-btns">
  84. <el-button
  85. size="mini"
  86. type="text"
  87. onClick={() => {
  88. this.detailsId = row.id
  89. this.pageType = 3
  90. }}
  91. >
  92. 查看
  93. </el-button>
  94. {row.examineStatus != 'OK' || row.examineStatus != 'CLOSE' ? (
  95. <el-button
  96. size="mini"
  97. type="text"
  98. onClick={() => {
  99. this.detailsId = row.id
  100. this.pageType = 2
  101. }}
  102. >
  103. 审批
  104. </el-button>
  105. ) : null}
  106. <el-popconfirm
  107. onOnConfirm={() => {
  108. deleteCustomerStockOrder({ id: row.id }).then(res => {
  109. this.$successMsg('删除成功')
  110. this.$refs.pageRef.refreshList()
  111. })
  112. }}
  113. title="删除吗?"
  114. >
  115. <el-button slot="reference" size="mini" type="text">
  116. 删除
  117. </el-button>
  118. </el-popconfirm>
  119. </div>
  120. )
  121. }
  122. }
  123. // 批量删除
  124. // dels() {
  125. // if (this.recordSelected.length) {
  126. // this.$confirm('此操作将删除数据, 是否继续?', '提示', {
  127. // confirmButtonText: '确定',
  128. // cancelButtonText: '取消',
  129. // type: 'warning'
  130. // })
  131. // .then(() => {
  132. // partsOldOutDel({
  133. // ids: this.recordSelected.map(item => item.id).join(',')
  134. // })
  135. // .then(res => {
  136. // this.$refs.pageRef.refreshList()
  137. // this.$message({
  138. // type: 'success',
  139. // message: '删除成功!'
  140. // })
  141. // })
  142. // .catch(() => {
  143. // this.$message({
  144. // type: 'error',
  145. // message: '删除失败'
  146. // })
  147. // })
  148. // })
  149. // .catch(() => {
  150. // this.$message({
  151. // type: 'info',
  152. // message: '已取消删除'
  153. // })
  154. // })
  155. // } else {
  156. // this.$message({
  157. // type: 'info',
  158. // message: '请先勾选需要删除的数据!'
  159. // })
  160. // }
  161. // }
  162. }
  163. }
  164. </script>
  165. <style lang="scss" scoped>
  166. ::v-deep .el-table__body-wrapper {
  167. height: 100% !important;
  168. }
  169. </style>