truckPrice.vue 2.6 KB

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