steel_reserved.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. //查询预留
  2. <template>
  3. <div class="steel_inbound">
  4. <div class="sache">
  5. <el-input
  6. placeholder="请输入内容"
  7. v-model="inputText"
  8. clearable>
  9. </el-input>
  10. <el-button type="primary" class="btn" @click="onclick">
  11. <i class="el-icon-search"></i>查询
  12. </el-button>
  13. <el-button type="primary" class="btn" @click="onreserved">
  14. 入库
  15. </el-button>
  16. </div>
  17. <div class="table">
  18. <dilTable v-bind.sync="options" @selection-change="selectionChange" ref="table">
  19. <el-table-column fixed="right" label="操作" width="150">
  20. <template slot-scope="scope">
  21. <el-button type="text" size="mini" @click="inboundDetails(scope)">
  22. 详情
  23. </el-button>
  24. </template>
  25. </el-table-column>
  26. </dilTable>
  27. </div>
  28. </div>
  29. </template>
  30. <script>
  31. export default {
  32. data(){
  33. return{
  34. inputText:"",
  35. options:{
  36. // first请求数据的地址
  37. requestUrl: "/api/v1/wms/getWmsReservedResult?apiId=371",
  38. selectionType: "select",
  39. mapList: [],
  40. },
  41. }
  42. },
  43. methods:{
  44. inboundDetails(scope){
  45. this.$router.push("/inboundDetails/" + scope.row.inboundId)
  46. },
  47. onclick(){
  48. console.log("点击事件");
  49. },
  50. selectionChange(selection) {
  51. this.options.mapList = selection;
  52. },
  53. onreserved(){
  54. console.log("fahaahahahaha")
  55. if (this.options.mapList.length == 0) {
  56. this.$message({
  57. type: "warning",
  58. message: "请先选择入库单!",
  59. });
  60. } else {
  61. this.$confirm("是否预留", "提示", {
  62. confirmButtonText: "确定",
  63. cancelButtonText: "取消",
  64. type: "warning",
  65. center: true,
  66. })
  67. .then(() => {
  68. //初始化maplist
  69. var mapList = [];
  70. this.options.mapList.forEach((item, i) => {
  71. //初始化mapItem
  72. var mapItem = {
  73. //入库实绩表id
  74. inboundId: 0,
  75. // 给一个标记定义其为预留变为入库
  76. status: 1,
  77. };
  78. mapItem.inboundId = item.inboundId;
  79. mapList.push(mapItem);
  80. });
  81. this.$message({
  82. type: "success",
  83. message: "预留成功!",
  84. });
  85. console.log(mapList)
  86. this.axios.post("/api/v1/wms/changeReserved", mapList).then((res) => {
  87. console.log("res.data"+res.data)
  88. if (res.data >= 1) {
  89. //改变查询条件
  90.       this.$refs.table.setDataRequestQuery({
  91. });  
  92. this.$router.go(0);
  93. }
  94. });
  95. console.log("fdagfaahh")
  96. })
  97. .catch(() => {
  98. this.$message({
  99. type: "info",
  100. message: "取消上传!",
  101. });
  102. });
  103. }
  104. }
  105. }
  106. }
  107. </script>
  108. <style lang="scss" scode>
  109. .steel_inbound{
  110. .sache{
  111. height: 5rem;
  112. display: flex;
  113. align-items: center;
  114. padding-left: 1.875rem;
  115. }
  116. }
  117. </style>