trainPrice.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <template>
  2. <!-- 水运单价页面 -->
  3. <div class="homeworkPath">
  4. <div class="top">
  5. <el-input v-model="input" placeholder="请输入内容"></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. </div>
  13. <dilTable v-bind.sync="option">
  14. <el-table-column fixed="right" label="操作" align="center" width="150">
  15. <template slot-scope="scope">
  16. <el-button @click="click(scope.row.priceId)" type="text" size="small"
  17. >编辑</el-button
  18. >
  19. <el-button
  20. type="text"
  21. size="small"
  22. @click="deleteclick(scope.row.priceId)"
  23. >删除</el-button
  24. >
  25. </template>
  26. </el-table-column>
  27. </dilTable>
  28. </div>
  29. </template>
  30. <script>
  31. export default {
  32. name: "homeworkPath",
  33. data() {
  34. return {
  35. input:'',
  36. restaurants: [],
  37. state: "",
  38. option: {
  39. // 表格请求数据的地址
  40. requestUrl: "/api/v1/ams/getTrainPriceList?apiId=116",
  41. },
  42. };
  43. },
  44. mounted() {
  45. },
  46. methods: {
  47. handleSelect(item) {
  48. console.log(item);
  49. },
  50. onclick() {
  51. console.log(1);
  52. },
  53. btnclick() {
  54. this.$router.push("/addTrainPrice/");
  55. },
  56. click(priceId) {
  57. this.$router.push("/updateTrainPrice/" + priceId);
  58. },
  59. // deleteclick(scope) {
  60. // let pathId = scope;
  61. // this.axios
  62. // .post("/api/v1/tms/operationPath/operationPathDelete?pathId=" + pathId)
  63. // .then((res) => {
  64. // this.$message({
  65. // message: "删除成功",
  66. // type: "success",
  67. // });
  68. // this.$router.go(0);
  69. // });
  70. // },
  71. deleteclick(scope) {
  72. let priceId = scope;
  73. this.$confirm("是否删除", "提示", {
  74. confirmButtonText: "确定",
  75. cancelButtonText: "取消",
  76. type: "warning",
  77. center: true,
  78. })
  79. .then(() => {
  80. this.$message({
  81. type: "success",
  82. message: "删除成功!",
  83. });
  84. this.axios
  85. .post(
  86. "/api/v1/ams/deleteTrainPrice/" + priceId
  87. )
  88. .then(() => {
  89. this.$router.go(0);
  90. });
  91. })
  92. .catch(() => {
  93. this.$message({
  94. type: "info",
  95. message: "取消删除!",
  96. });
  97. });
  98. },
  99. },
  100. };
  101. </script>
  102. <style lang='scss' scoped>
  103. .homeworkPath {
  104. .top {
  105. padding: 1.25rem 1.875rem;
  106. }
  107. }
  108. </style>