cargoDep.vue 2.7 KB

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