warehouse_book.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <template>
  2. <div class="app-container">
  3. <el-card class="box-card">
  4. <div slot="header" class="clearfix">
  5. <span>仓库每天预约提货设置</span>
  6. </div>
  7. <!-- 列表 -->
  8. <div class="">
  9. <el-table
  10. v-loading="listLoading"
  11. :data="dataList"
  12. element-loading-text="Loading"
  13. border
  14. fit
  15. highlight-current-row
  16. stripe
  17. >
  18. <el-table-column
  19. align="center"
  20. label="序号"
  21. type="index"
  22. min-width="60"
  23. show-overflow-tooltip
  24. />
  25. <el-table-column
  26. align="center"
  27. label="仓库"
  28. prop="stockName"
  29. min-width="160"
  30. show-overflow-tooltip
  31. />
  32. <el-table-column
  33. align="center"
  34. label="预约存货类型"
  35. prop="type"
  36. min-width="160"
  37. show-overflow-tooltip
  38. />
  39. <el-table-column
  40. align="center"
  41. label="最大预约单量(1天)"
  42. prop="number"
  43. min-width="160"
  44. show-overflow-tooltip
  45. >
  46. <template slot-scope="scope">
  47. <el-input type="number" v-model.number="scope.row.number" :disabled="scope.row.isDisabled"></el-input>
  48. </template>
  49. </el-table-column>
  50. <el-table-column
  51. align="center"
  52. label="最大预约台数(1天)"
  53. prop="towerNum"
  54. min-width="160"
  55. show-overflow-tooltip
  56. >
  57. <template slot-scope="scope">
  58. <el-input type="number" v-model.number="scope.row.towerNum" :disabled="scope.row.isDisabled"></el-input>
  59. </template>
  60. </el-table-column>
  61. <el-table-column
  62. align="center"
  63. label="操作"
  64. min-width="160"
  65. show-overflow-tooltip
  66. >
  67. <template slot-scope="scope">
  68. <el-button type="text" class="textColor" @click="hanleEidt(scope.$index)"
  69. >编辑</el-button
  70. >
  71. <el-button type="text" class="textColor" @click="hanleSave(scope.row)">保存</el-button>
  72. </template>
  73. </el-table-column>
  74. </el-table>
  75. </div>
  76. </el-card>
  77. </div>
  78. </template>
  79. <script>
  80. import Mixin from "@/mixin/index";
  81. import { getListReserve,addReserve } from "@/api/basic_data/warehouse";
  82. export default {
  83. mixins: [Mixin],
  84. data() {
  85. return {
  86. dataList: [
  87. {
  88. num: "1",
  89. store: "万豪仓",
  90. type: "家用空调",
  91. maxNum: "1111",
  92. maxSets: "12331",
  93. },
  94. {
  95. num: "1",
  96. store: "万豪仓",
  97. type: "家用空调",
  98. maxNum: "1111",
  99. maxSets: "",
  100. },
  101. {
  102. num: "1",
  103. store: "万豪仓",
  104. type: "家用空调",
  105. maxNum: "1111",
  106. maxSets: "",
  107. },
  108. {
  109. num: "1",
  110. store: "万豪仓",
  111. type: "家用空调",
  112. maxNum: "1111",
  113. maxSets: "",
  114. },
  115. ],
  116. index:0
  117. };
  118. },
  119. created() {
  120. this.getList();
  121. },
  122. methods: {
  123. hanleEidt(i){
  124. this.dataList.forEach(e=>{
  125. e.isDisabled = true
  126. })
  127. this.dataList[i].isDisabled = false
  128. },
  129. hanleSave(edata){
  130. const params = {
  131. ...edata
  132. }
  133. addReserve(params).then(res=>{
  134. this.$successMsg("保存成功");
  135. this.dataList.forEach(e=>{
  136. e.isDisabled = true
  137. })
  138. })
  139. },
  140. getList() {
  141. this.listLoading = true;
  142. let params = {
  143. pageNum: this.currentPage,
  144. pageSize: this.pageSize,
  145. };
  146. getListReserve(params).then((res) => {
  147. res.data.records.forEach(el => {
  148. el.isDisabled=true
  149. });
  150. this.dataList = res.data.records;
  151. this.listTotal = res.data.total;
  152. this.listLoading = false;
  153. console.log(this.dataList, 1233);
  154. });
  155. },
  156. },
  157. };
  158. </script>
  159. <style lang="scss" scoped></style>