loadShip.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <!-- 装船作业页面 -->
  3. <div class="shipTransport">
  4. <div class="top">
  5. <el-input
  6. class="el-input"
  7. placeholder="请输入内容"
  8. v-model="input"
  9. clearable
  10. >
  11. </el-input>
  12. <el-button type="primary" class="btn" @click="onclick">
  13. <i class="el-icon-search"></i>查询
  14. </el-button>
  15. <el-button type="primary" class="btn" @click="addclick">
  16. <i class="el-icon-circle-plus-outline"></i>新增
  17. </el-button>
  18. </div>
  19. <dilTable v-bind.sync="option">
  20. <el-table-column fixed="right" label="操作" align="center" width="100">
  21. <template slot-scope="scope">
  22. <el-button @click="click(scope.row.resultId)" type="text" size="small"
  23. >编辑</el-button
  24. >
  25. <el-button
  26. type="text"
  27. size="small"
  28. @click="deleteclick(scope.row.resultId)"
  29. >删除</el-button
  30. >
  31. </template>
  32. </el-table-column>
  33. </dilTable>
  34. </div>
  35. </template>
  36. <script>
  37. export default {
  38. name: "homeworkPath",
  39. data() {
  40. return {
  41. restaurants: [],
  42. input: "",
  43. option: {
  44. // 表格请求数据的地址
  45. requestUrl: "/api/v1/tms/getLoadShipList?apiId=63"
  46. }
  47. };
  48. },
  49. mounted() {},
  50. methods: {
  51. onclick() {
  52. // this.option.requestUrl = "/api/v1/tms/getLoadShipList?apiId=63&con=" + this.input;
  53. },
  54. click(resultId) {
  55. console.log("aaa" + resultId);
  56. this.$router.push("/updateLoadShip/" + resultId);
  57. },
  58. addclick() {
  59. this.$router.push("/addLoadShip/");
  60. },
  61. deleteclick(scope) {
  62. let resultId = scope;
  63. this.$confirm("是否删除", "提示", {
  64. confirmButtonText: "确定",
  65. cancelButtonText: "取消",
  66. type: "warning",
  67. center: true
  68. })
  69. .then(() => {
  70. this.axios.post("/api/v1/tms/deleteLoadShip/" + resultId).then(() => {
  71. this.$message({
  72. type: "success",
  73. message: "删除成功!"
  74. });
  75. this.option.requestUrl =
  76. "/api/v1/tms/getLoadShipList?apiId=63&i=" + new Date();
  77. });
  78. })
  79. .catch(() => {
  80. this.$message({
  81. type: "info",
  82. message: "取消删除!"
  83. });
  84. });
  85. }
  86. }
  87. };
  88. </script>
  89. <style lang="scss" scoped>
  90. .shipTransport {
  91. .top {
  92. padding: 1.25rem 0.375rem;
  93. .el-input {
  94. width: 20%;
  95. margin-right: 40rpx;
  96. }
  97. .btn {
  98. width: 5.5%;
  99. margin-left: 0.25rem;
  100. }
  101. }
  102. }
  103. </style>