wagonLoadMine.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <template>
  2. <!-- 装车作业页面 -->
  3. <div class="homeworkPath">
  4. <div class="top">
  5. <el-input class="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="btnclick(0)">
  10. <i class="el-icon-plus"></i>新增
  11. </el-button>
  12. <el-button type="primary" @click="btnclick(1)">
  13. <i class="el-icon-edit-outline"></i>补录
  14. </el-button>
  15. </div>
  16. <dilTable v-bind.sync="option">
  17. <el-table-column fixed="right" label="操作" width="100">
  18. <template slot-scope="scope">
  19. <el-button @click="click(scope.row.resultId)" type="text" size="small"
  20. >修改</el-button
  21. >
  22. <el-button
  23. type="text"
  24. size="small"
  25. @click="deleteclick(scope.row.resultId)"
  26. >删除</el-button
  27. >
  28. </template>
  29. </el-table-column>
  30. </dilTable>
  31. </div>
  32. </template>
  33. <script>
  34. export default {
  35. name: "wagonload",
  36. data() {
  37. return {
  38. input: "",
  39. option: {
  40. // 表格请求数据的地址
  41. requestUrl: "/api/v1/tms/getTmstrainWagonLoad?apiId=209&resultType=3",
  42. },
  43. };
  44. },
  45. methods: {
  46. onclick() {
  47. this.option.requestUrl =
  48. "/api/v1/tms/getTmstrainWagonLoad?apiId=209&resultType=3&con=" +
  49. this.input;
  50. },
  51. btnclick(index) {
  52. if(index == 0){
  53. this.$router.push("/wagonLoadAdd");
  54. }else if(index == 1){
  55. this.$router.push("/wagonLoadbu");
  56. }
  57. },
  58. click(resultId) {
  59. console.log("点击了")
  60. console.log(resultId)
  61. this.$router.push("/wagonLoadEdit/" + resultId);
  62. },
  63. deleteclick(scope) {
  64. let resultId = scope;
  65. this.$confirm("是否删除", "提示", {
  66. confirmButtonText: "确定",
  67. cancelButtonText: "取消",
  68. type: "warning",
  69. center: true,
  70. })
  71. .then(() => {
  72. this.$message({
  73. type: "success",
  74. message: "删除成功!",
  75. });
  76. this.axios
  77. .post(
  78. "/api/v1/tms/deleteTmstrainLoadingResultByResultId?resultId=" +
  79. resultId
  80. )
  81. .then(() => {
  82. this.$router.go(0);
  83. });
  84. })
  85. .catch(() => {
  86. this.$message({
  87. type: "info",
  88. message: "取消删除!",
  89. });
  90. });
  91. },
  92. },
  93. };
  94. </script>
  95. <style lang='scss' scoped>
  96. .homeworkPath {
  97. .top {
  98. padding: 1.25rem 0.375rem;
  99. .el-input{
  100. width: 20%;
  101. margin-right: 40rpx;
  102. }
  103. .btn{
  104. width: 5.5%;
  105. margin-left: 0.25rem;
  106. }
  107. }
  108. }
  109. </style>