portStorageYard.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. //资源管理港存堆场
  2. <template>
  3. <div class="steel_inbound">
  4. <div class="sache">
  5. <el-input
  6. placeholder="请输入内容"
  7. v-model="inputText"
  8. clearable>
  9. </el-input>
  10. <el-button type="primary" class="btn" @click="onclick">
  11. <i class="el-icon-search"></i>查询
  12. </el-button>
  13. <el-button type="primary" class="btn" @click="toInsert">
  14. <i class="el-icon-plus"></i>新增
  15. </el-button>
  16. </div>
  17. <div class="table">
  18. <dilTable v-bind.sync="options">
  19. <el-table-column fixed="right" label="操作" width="100">
  20. <template slot-scope="scope">
  21. <el-button
  22. type="text"
  23. size="mini"
  24. @click="deleteBmsTrainFreight(scope)"
  25. >
  26. 删除
  27. </el-button>
  28. </template>
  29. </el-table-column>
  30. </dilTable>
  31. </div>
  32. </div>
  33. </template>
  34. <script>
  35. export default {
  36. data(){
  37. return{
  38. inputText:"",
  39. options:{
  40. // first请求数据的地址
  41. requestUrl: "/api/v1/rms/getYardList?apiId=224",
  42. },
  43. }
  44. },
  45. methods:{
  46. onclick(){
  47. if(this.inputText != null){
  48. this.options.requestUrl = "/api/v1/rms/getYardList?apiId=224"
  49. }else{
  50. this.options.requestUrl = "/api/v1/rms/getYardList?apiId=224&test=1"
  51. }
  52. },
  53. toInsert() {
  54. this.$router.push("/addPortStorageYard");
  55. },
  56. deleteBmsTrainFreight(scope){
  57. this.$confirm("是否删除", "提示", {
  58. confirmButtonText: "确定",
  59. cancelButtonText: "取消",
  60. type: "warning",
  61. center: true,
  62. })
  63. .then(() => {
  64. this.axios
  65. .post("/api/v1/rms/deletePortYard/" + scope.row.warehouseId)
  66. .then((res) => {
  67. if (res.data.code == 200) {
  68. this.$message({
  69. type: "success",
  70. message: "删除成功!",
  71. });
  72. this.options.requestUrl = "/api/v1/rms/getYardList?apiId=224&test=1"
  73. } else {
  74. this.$message({
  75. message: "删除失败",
  76. type: "warning",
  77. });
  78. }
  79. });
  80. })
  81. .catch(() => {
  82. this.$message({
  83. type: "info",
  84. message: "删除操作已取消!",
  85. });
  86. });
  87. },
  88. },
  89. }
  90. </script>
  91. <style lang="scss" scode>
  92. .steel_inbound{
  93. .sache{
  94. padding: 1.25rem 0.375rem;
  95. .el-input {
  96. width: 20%;
  97. margin-right: 1.25rem;
  98. }
  99. }
  100. }
  101. </style>