wagonPlease.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <template>
  2. <!-- 请车作业页面 -->
  3. <div class="homeworkPath">
  4. <div class="top">
  5. <el-input placeholder="请输入内容" v-model="inputText" clearable>
  6. </el-input>
  7. <el-button type="primary" class="btn" @click="onclick">
  8. <i class="el-icon-search"></i>查询
  9. </el-button>
  10. <el-button type="primary" @click="insertClick">
  11. <i class="el-icon-plus"></i>新增
  12. </el-button>
  13. </div>
  14. <el-tabs v-model="activeName" @tab-click="handleClick">
  15. <!-- 未下发 -->
  16. <el-tab-pane label="未下发" name="first">
  17. <dilTable v-bind.sync="option1" ref="table">
  18. <el-table-column fixed="right" label="操作" width="120">
  19. <template slot-scope="scope">
  20. <el-button
  21. @click="updateClick(scope.row.resultId)"
  22. type="text"
  23. size="small"
  24. >
  25. 修改
  26. </el-button>
  27. <el-button
  28. @click="deleteClick(scope.row.resultId)"
  29. type="text"
  30. size="small"
  31. >
  32. 删除
  33. </el-button>
  34. <el-button
  35. @click="sendClick(scope.row.resultId)"
  36. type="text"
  37. size="small"
  38. >
  39. 下发
  40. </el-button>
  41. </template>
  42. </el-table-column>
  43. </dilTable>
  44. </el-tab-pane>
  45. <!-- 已下发 -->
  46. <el-tab-pane label="已下发" name="second">
  47. <dilTable v-bind.sync="option2"> </dilTable>
  48. </el-tab-pane>
  49. </el-tabs>
  50. </div>
  51. </template>
  52. <script>
  53. export default {
  54. name: "inplantTMS",
  55. data() {
  56. return {
  57. inputText: "",
  58. activeName: "first",
  59. option1: {
  60. // 表格请求数据的地址
  61. requestUrl:
  62. "/api/v1/tms/getAllWagonPlease?apiId=253&status=0&resultType=4",
  63. },
  64. option2: {
  65. // 表格请求数据的地址
  66. requestUrl:
  67. "/api/v1/tms/getAllWagonPlease?apiId=253&status=1&resultType=4",
  68. },
  69. };
  70. },
  71. methods: {
  72. onclick() {
  73. if(this.activeName == 'first'){
  74. this.option1.requestUrl = "/api/v1/tms/getAllWagonPlease?apiId=253&status=0&resultType=4&con=" + this.inputText;
  75. }else{
  76. this.option1.requestUrl = "/api/v1/tms/getAllWagonPlease?apiId=253&status=1&resultType=4&con=" + this.inputText;
  77. }
  78. },
  79. handleClick(tab, event) {
  80. console.log(tab, event);
  81. },
  82. // 删除
  83. deleteClick(resultId) {
  84. this.$confirm("是否删除", "提示", {
  85. confirmButtonText: "确定",
  86. cancelButtonText: "取消",
  87. type: "warning",
  88. center: true,
  89. })
  90. .then(() => {
  91. this.$axios
  92. .post("/api/v1/tms/deleteApproveWagonPlease/" + resultId)
  93. .then((res) => {
  94. if (res.data.code == "200") {
  95. this.$message({
  96. type: "success",
  97. message: "删除成功!",
  98. });
  99. this.$router.go(0);
  100. }
  101. });
  102. })
  103. .catch(() => {
  104. this.$message({
  105. type: "info",
  106. message: "取消删除!",
  107. });
  108. });
  109. },
  110. // 下发
  111. sendClick(resultId) {
  112. this.$confirm("是否下发", "提示", {
  113. confirmButtonText: "确定",
  114. cancelButtonText: "取消",
  115. type: "warning",
  116. center: true,
  117. })
  118. .then(() => {
  119. // console.log(this.arr[0].text_prop);
  120. this.$axios
  121. .post("/api/v1/tms/sendWagonPlease/" + resultId)
  122. .then((res) => {
  123. if (res.data.code == "200") {
  124. this.$message({
  125. type: "success",
  126. message: "下发成功!",
  127. });
  128. this.$router.go(0);
  129. }
  130. });
  131. })
  132. .catch(() => {
  133. this.$message({
  134. type: "info",
  135. message: "取消下发!",
  136. });
  137. });
  138. },
  139. //新增
  140. insertClick() {
  141. console.log("11");
  142. this.$router.push("/truckTrain/addWagonPlease");
  143. },
  144. //修改
  145. updateClick(resultId) {
  146. this.$router.push("/truckTrain/editWagonPlease/" + resultId);
  147. },
  148. },
  149. };
  150. </script>
  151. <style lang='scss'>
  152. .homeworkPath {
  153. .top {
  154. padding: 1.25rem 1.875rem;
  155. }
  156. }
  157. </style>