dispatchPlan.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. // 分派计划
  2. <template>
  3. <div class="steel_inbound">
  4. <div class="sache">
  5. <el-input placeholder="请输入内容" v-model="inputText" clearable>
  6. </el-input>
  7. <el-button type="primary" class="btn">
  8. <i class="el-icon-search"></i>查询
  9. </el-button>
  10. <el-button
  11. type="primary"
  12. class="btn"
  13. @click="dispatch"
  14. v-if="activeName == 'first'"
  15. >
  16. <i class="el-icon-download"></i>分派</el-button
  17. >
  18. </div>
  19. <template>
  20. <div>
  21. <el-tabs v-model="activeName" @tab-click="handleClick">
  22. <el-tab-pane label="未分派" name="first">
  23. <dilTable v-bind.sync="first" @selection-change="selectionChange">
  24. </dilTable>
  25. </el-tab-pane>
  26. <el-tab-pane label="已分派" name="second">
  27. <dilTable v-bind.sync="second"> </dilTable>
  28. </el-tab-pane>
  29. </el-tabs>
  30. </div>
  31. </template>
  32. </div>
  33. </template>
  34. <script>
  35. export default {
  36. data() {
  37. return {
  38. inputText: "",
  39. first: {
  40. // first请求数据的地址
  41. requestUrl:
  42. "/api/v1/oms/getInwardOrderList?apiId=260&orderStatus=3&carrierId=40",
  43. selectionType: "select",
  44. mapList: [],
  45. },
  46. second: {
  47. // second请求数据的地址
  48. requestUrl:
  49. "/api/v1/oms/getInwardOrderList?apiId=260&orderStatus=4&carrierId=40",
  50. },
  51. activeName: "first",
  52. };
  53. },
  54. methods: {
  55. selectionChange(selection) {
  56. this.first.mapList = selection
  57. },
  58. dispatch() {
  59. if(this.first.mapList.length == 0){
  60. this.$alert('请选择订单')
  61. return
  62. }
  63. this.$confirm("是否分派", "提示", {
  64. confirmButtonText: "确定",
  65. cancelButtonText: "取消",
  66. type: "warning",
  67. center: true,
  68. })
  69. .then(() => {
  70. this.axios
  71. .post("/api/v1/oms/apportionInwardOrder", this.first.mapList)
  72. .then((res) => {
  73. if (res.data.code == 200) {
  74. this.$message({
  75. type: "success",
  76. message: "分派成功!",
  77. });
  78. this.first.requestUrl = "/api/v1/oms/getInwardOrderList?apiId=260&orderStatus=3&carrierId=40&test=1"
  79. this.second.requestUrl = "/api/v1/oms/getInwardOrderList?apiId=260&orderStatus=4&carrierId=40&test=1"
  80. this.activeName = 'second'
  81. this.first.mapList = []
  82. } else {
  83. this.$message({
  84. message: "分派失败",
  85. type: "warning",
  86. });
  87. }
  88. });
  89. })
  90. .catch(() => {
  91. this.$message({
  92. type: "info",
  93. message: "分派操作已取消!",
  94. });
  95. });
  96. },
  97. deletePlan(scope) {
  98. this.$confirm("是否删除", "提示", {
  99. confirmButtonText: "确定",
  100. cancelButtonText: "取消",
  101. type: "warning",
  102. center: true,
  103. })
  104. .then(() => {
  105. this.axios
  106. .post(
  107. "/api/v1/bms/deleteTrainSettlement/" + scope.row.requirementId
  108. )
  109. .then((res) => {
  110. if (res.data.code == 200) {
  111. this.$message({
  112. type: "success",
  113. message: "删除成功!",
  114. });
  115. this.$router.go(0);
  116. } else {
  117. this.$message({
  118. message: "删除失败",
  119. type: "warning",
  120. });
  121. }
  122. });
  123. })
  124. .catch(() => {
  125. this.$message({
  126. type: "info",
  127. message: "删除操作已取消!",
  128. });
  129. });
  130. },
  131. },
  132. };
  133. </script>
  134. <style lang="scss">
  135. .steel_inbound{
  136. .sache{
  137. padding: 1.25rem 0.375rem;
  138. .el-input {
  139. width: 20%;
  140. margin-right: 1.25rem;
  141. }
  142. }
  143. }
  144. </style>