wagonPlease.vue 4.0 KB

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