dispatchPlan.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  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. import { getCookie } from "@/utils/util.js";
  36. export default {
  37. data() {
  38. return {
  39. inputText: "",
  40. userCarrierId:'',
  41. first: {
  42. // first请求数据的地址
  43. requestUrl:
  44. "/api/v1/oms/getInwardOrderList?apiId=260&orderStatus=3&carrierId=" + '',
  45. selectionType: "select",
  46. mapList: [],
  47. },
  48. second: {
  49. // second请求数据的地址
  50. requestUrl:
  51. "/api/v1/oms/getInwardOrderList?apiId=260&orderStatus=4&carrierId=" + '',
  52. },
  53. activeName: "first",
  54. };
  55. },
  56. created(){
  57. this.userCarrierId = getCookie('userId'),
  58. this.first.requestUrl = "/api/v1/oms/getInwardOrderList?apiId=260&orderStatus=3"
  59. this.second.requestUrl = "/api/v1/oms/getInwardOrderList?apiId=260&orderStatus=4"
  60. },
  61. methods: {
  62. selectionChange(selection) {
  63. this.first.mapList = selection
  64. },
  65. dispatch() {
  66. if(this.first.mapList.length == 0){
  67. this.$alert('请选择订单')
  68. return
  69. }
  70. this.$confirm("是否分派", "提示", {
  71. confirmButtonText: "确定",
  72. cancelButtonText: "取消",
  73. type: "warning",
  74. center: true,
  75. })
  76. .then(() => {
  77. this.axios
  78. .post("/api/v1/oms/apportionInwardOrder", this.first.mapList)
  79. .then((res) => {
  80. if (res.data.code == 200) {
  81. this.$message({
  82. type: "success",
  83. message: "分派成功!",
  84. });
  85. } else {
  86. this.$message({
  87. message: "分派失败",
  88. type: "warning",
  89. });
  90. }
  91. });
  92. })
  93. .catch(() => {
  94. this.$message({
  95. type: "info",
  96. message: "分派操作已取消!",
  97. });
  98. });
  99. },
  100. deletePlan(scope) {
  101. this.$confirm("是否删除", "提示", {
  102. confirmButtonText: "确定",
  103. cancelButtonText: "取消",
  104. type: "warning",
  105. center: true,
  106. })
  107. .then(() => {
  108. this.axios
  109. .post(
  110. "/api/v1/bms/deleteTrainSettlement/" + scope.row.requirementId
  111. )
  112. .then((res) => {
  113. if (res.data.code == 200) {
  114. this.$message({
  115. type: "success",
  116. message: "删除成功!",
  117. });
  118. } else {
  119. this.$message({
  120. message: "删除失败",
  121. type: "warning",
  122. });
  123. }
  124. });
  125. })
  126. .catch(() => {
  127. this.$message({
  128. type: "info",
  129. message: "删除操作已取消!",
  130. });
  131. });
  132. },
  133. },
  134. };
  135. </script>
  136. <style lang="scss">
  137. .steel_inbound{
  138. .sache{
  139. padding: 1.25rem 0.375rem;
  140. .el-input {
  141. width: 20%;
  142. margin-right: 1.25rem;
  143. }
  144. }
  145. }
  146. </style>