cargoResult.vue 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. console.log(this.input)
  46. this.option.requestUrl = "/api/v1/tms/getAmsshipCargoTranferResultList?apiId=66&con=" + this.input;
  47. },
  48. addClick() {
  49. this.$router.push("/addCargoResult/");
  50. },
  51. modifyclick(cargoTransferResultId){
  52. this.$router.push("/modifyCargoResult/" + cargoTransferResultId);
  53. },
  54. deleteclick(scope) {
  55. let cargoTransferResultId = scope;
  56. this.$confirm("是否删除", "提示", {
  57. confirmButtonText: "确定",
  58. cancelButtonText: "取消",
  59. type: "warning",
  60. center: true,
  61. })
  62. .then(() => {
  63. this.$message({
  64. type: "success",
  65. message: "删除成功!",
  66. });
  67. this.axios
  68. .post(
  69. "/api/v1/tms/deleteByCargoId/" + cargoTransferResultId
  70. )
  71. .then(() => {
  72. this.$router.go(0);
  73. });
  74. })
  75. .catch(() => {
  76. this.$message({
  77. type: "info",
  78. message: "取消删除!",
  79. });
  80. });
  81. },
  82. },
  83. };
  84. </script>
  85. <style lang='scss' scoped>
  86. .shipTransport {
  87. .top {
  88. padding: 1.25rem 0.375rem;
  89. .el-input {
  90. width: 20%;
  91. margin-right: 1.25rem;
  92. }
  93. }
  94. }
  95. </style>