wagonUnLoad.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <template>
  2. <!-- 卸车作业页面 -->
  3. <div class="homeworkPath">
  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" @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="操作" width="100">
  15. <template slot-scope="scope">
  16. <el-button
  17. @click="click(scope.row.unloadingId)"
  18. type="text"
  19. size="small"
  20. >修改</el-button
  21. >
  22. <el-button
  23. type="text"
  24. size="small"
  25. @click="deleteclick(scope.row.unloadingId)"
  26. >删除</el-button
  27. >
  28. </template>
  29. </el-table-column>
  30. </dilTable>
  31. </div>
  32. </template>
  33. <script>
  34. export default {
  35. name: "wagonUnload",
  36. data() {
  37. return {
  38. input: "",
  39. option: {
  40. // 表格请求数据的地址
  41. requestUrl: "/api/v1/tms/getTmstrainWagonUnLoad?apiId=60&resultType=1",
  42. },
  43. };
  44. },
  45. methods: {
  46. onclick() {
  47. this.option.requestUrl = "/api/v1/tms/getTmstrainWagonUnLoad?apiId=60&resultType=1&con="+this.input;
  48. },
  49. btnclick() {
  50. this.$router.push("/addWagonUnLoad");
  51. },
  52. click(unloadingId) {
  53. this.$router.push("/editWagonUnLoad/" + unloadingId);
  54. },
  55. deleteclick(scope) {
  56. let unloadingId = scope;
  57. this.$confirm("是否删除", "提示", {
  58. confirmButtonText: "确定",
  59. cancelButtonText: "取消",
  60. type: "warning",
  61. center: true,
  62. })
  63. .then(() => {
  64. this.$message({
  65. type: "success",
  66. message: "删除成功!",
  67. });
  68. this.axios
  69. .post(
  70. "/api/v1/tms/deleteTmstrainWagonUnLoadResultByUnLoadingId?unloadingId=" +
  71. unloadingId
  72. )
  73. .then(() => {
  74. this.$router.go(0);
  75. });
  76. })
  77. .catch(() => {
  78. this.$message({
  79. type: "info",
  80. message: "取消删除!",
  81. });
  82. });
  83. },
  84. },
  85. };
  86. </script>
  87. <style lang='scss' scoped>
  88. .homeworkPath {
  89. .top {
  90. padding: 1.25rem 0.375rem;
  91. .el-input{
  92. width: 20%;
  93. margin-right: 40rpx;
  94. }
  95. .btn{
  96. width: 5.5%;
  97. margin-left: 0.25rem;
  98. }
  99. }
  100. }
  101. </style>