truckPrice.vue 2.6 KB

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