loadShip.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <!-- 装船作业页面 -->
  3. <div class="shipTransport">
  4. <div class="top">
  5. <el-input class="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="操作" align="center" width="100">
  15. <template slot-scope="scope">
  16. <el-button @click="click(scope.row.resultId)" type="text" size="small"
  17. >编辑</el-button
  18. >
  19. <el-button
  20. type="text"
  21. size="small"
  22. @click="deleteclick(scope.row.resultId)"
  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/getLoadShipList?apiId=63",
  40. },
  41. };
  42. },
  43. mounted() {
  44. },
  45. methods: {
  46. onclick() {
  47. this.option.requestUrl = "/api/v1/tms/getLoadShipList?apiId=63&con=" + this.input;
  48. },
  49. click(resultId) {
  50. this.$router.push("/updateLoadShip/" + resultId);
  51. },
  52. addclick() {
  53. this.$router.push("/addLoadShip/");
  54. },
  55. deleteclick(scope) {
  56. let resultId = scope;
  57. this.$confirm("是否删除", "提示", {
  58. confirmButtonText: "确定",
  59. cancelButtonText: "取消",
  60. type: "warning",
  61. center: true,
  62. })
  63. .then(() => {
  64. this.axios
  65. .post(
  66. "/api/v1/tms/deleteLoadShip/" + resultId
  67. )
  68. .then(() => {
  69. this.$message({
  70. type: "success",
  71. message: "删除成功!",
  72. });
  73. this.$router.go(0);
  74. });
  75. })
  76. .catch(() => {
  77. this.$message({
  78. type: "info",
  79. message: "取消删除!",
  80. });
  81. });
  82. },
  83. },
  84. };
  85. </script>
  86. <style lang='scss' scoped>
  87. .shipTransport {
  88. .top {
  89. padding: 1.25rem 0.375rem;
  90. .el-input{
  91. width: 20%;
  92. margin-right: 40rpx;
  93. }
  94. .btn{
  95. width: 5.5%;
  96. margin-left: 0.25rem;
  97. }
  98. }
  99. }
  100. </style>