cargoResult.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <!-- 货权转移页面 -->
  3. <div class="shipTransport">
  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" class="btn" @click="addClick">
  10. <i class="el-icon-circle-plus-outline"></i>新增
  11. </el-button>
  12. </div>
  13. <dilTable v-bind.sync="option">
  14. <el-table-column fixed="right" label="操作" width="100">
  15. <template slot-scope="scope">
  16. <el-button @click="modifyclick(scope.row.cargoTransferResultId)" type="text" size="small"
  17. >修改</el-button
  18. >
  19. <el-button
  20. type="text"
  21. size="small"
  22. @click="deleteclick(scope.row.cargoTransferResultId)"
  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. restaurants: [],
  36. input: "",
  37. option: {
  38. // 表格请求数据的地址
  39. requestUrl: "/api/v1/tms/getAmsshipCargoTranferResultList?apiId=66",
  40. },
  41. };
  42. },
  43. methods: {
  44. onclick() {
  45. // this.option.requestUrl = "/api/v1/tms/getAmsshipCargoTranferResultList?apiId=66&con=" + this.input;
  46. },
  47. addClick() {
  48. this.$router.push("/addCargoResult/");
  49. },
  50. modifyclick(cargoTransferResultId){
  51. this.$router.push("/modifyCargoResult/" + cargoTransferResultId);
  52. },
  53. deleteclick(scope) {
  54. let cargoTransferResultId = scope;
  55. this.$confirm("是否删除", "提示", {
  56. confirmButtonText: "确定",
  57. cancelButtonText: "取消",
  58. type: "warning",
  59. center: true,
  60. })
  61. .then(() => {
  62. this.$message({
  63. type: "success",
  64. message: "删除成功!",
  65. });
  66. this.axios
  67. .post(
  68. "/api/v1/tms/deleteByCargoId/" + cargoTransferResultId
  69. )
  70. .then(() => {
  71. this.$router.go(0);
  72. });
  73. })
  74. .catch(() => {
  75. this.$message({
  76. type: "info",
  77. message: "取消删除!",
  78. });
  79. });
  80. },
  81. },
  82. };
  83. </script>
  84. <style lang='scss' scoped>
  85. .shipTransport {
  86. .top {
  87. padding: 1.25rem 0.375rem;
  88. .el-input {
  89. width: 20%;
  90. margin-right: 1.25rem;
  91. }
  92. }
  93. }
  94. </style>