capacity.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. //资源管理运力
  2. <template>
  3. <div class="steel_inbound">
  4. <div class="sache">
  5. <el-input
  6. placeholder="请输入内容"
  7. v-model="textInput"
  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="small"
  24. @click="updateCapacity(scope.row.capacityId)"
  25. >
  26. 修改
  27. </el-button>
  28. </template>
  29. </el-table-column>
  30. </dilTable>
  31. </div>
  32. </div>
  33. </template>
  34. <script>
  35. import { getCookie } from "@/utils/util.js";
  36. export default {
  37. data(){
  38. return{
  39. name:"homeworkPath",
  40. textInput:"",
  41. restaurants: [],
  42. ssoId:null,
  43. options:{
  44. // first请求数据的地址
  45. requestUrl: "",
  46. },
  47. }
  48. },
  49. created(){
  50. if(getCookie("orgCode") == "chengyunshang"){
  51. this.options.requestUrl = "/api/v1/rms/getCapacityList?apiId=397&carrierSSOId="+ getCookie("userId");
  52. }else{
  53. this.options.requestUrl = "/api/v1/rms/getCapacityList?apiId=397&carrierSSOId=" + this.ssoId;
  54. }
  55. },
  56. methods:{
  57. onclick(){
  58. if(getCookie("orgCode") == "chengyunshang"){
  59. this.options.requestUrl = "/api/v1/rms/getCapacityList?apiId=397&carrierSSOId="+ getCookie("userId") +"&con=" +this.textInput + "&i=" + new Date();
  60. }else{
  61. this.options.requestUrl = "/api/v1/rms/getCapacityList?apiId=397&carrierSSOId="+ null +"&con=" +this.textInput + "&i=" + new Date();
  62. }
  63. },
  64. toInsert() {
  65. this.$router.push("/addCapacity");
  66. },
  67. updateCapacity(capacityId){
  68. this.$router.push("/editCapacity/" + capacityId)
  69. },
  70. deleteCapacity(scope){
  71. this.$confirm("是否删除", "提示", {
  72. confirmButtonText: "确定",
  73. cancelButtonText: "取消",
  74. type: "warning",
  75. center: true,
  76. })
  77. .then(() => {
  78. this.axios
  79. .post("/api/v1/rms/deleteCapacity/" + scope.row.capacityId)
  80. .then((res) => {
  81. if (res.data.code == 200) {
  82. this.$message({
  83. type: "success",
  84. message: "删除成功!",
  85. });
  86. this.$router.go(0);
  87. } else {
  88. this.$message({
  89. message: "删除失败",
  90. type: "warning",
  91. });
  92. }
  93. });
  94. })
  95. .catch(() => {
  96. this.$message({
  97. type: "info",
  98. message: "删除操作已取消!",
  99. });
  100. });
  101. },
  102. },
  103. }
  104. </script>
  105. <style lang="scss" scode>
  106. .steel_inbound{
  107. .sache{
  108. padding: 1.25rem 0.375rem;
  109. .el-input {
  110. width: 20%;
  111. margin-right: 1.25rem;
  112. }
  113. }
  114. }
  115. </style>