adjust_warehouse.vue 4.9 KB

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