transitRoute.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. // 运输路线
  2. <template>
  3. <div class="steel_inbound">
  4. <div class="top">
  5. <!-- 框计算 -->
  6. <el-input placeholder="请输入内容" v-model="inputText" clearable>
  7. </el-input>
  8. <el-button type="primary" class="btn" @click="onclick">
  9. <i class="el-icon-search"></i>查询
  10. </el-button>
  11. <el-button type="primary" class="btn" @click="AddClick">
  12. <i class="el-icon-plus"></i>新增
  13. </el-button>
  14. </div>
  15. <div class="tab">
  16. <dilTable v-bind.sync="option">
  17. <el-table-column label="操作">
  18. <template slot-scope="scope">
  19. <el-button
  20. type="text"
  21. size="mini"
  22. @click="transitRouteUpdata(scope.row.lineId)"
  23. >修改</el-button
  24. >
  25. <el-button
  26. size="mini"
  27. type="text"
  28. @click="transitRouteDelete(scope.row.lineId)"
  29. >删除</el-button
  30. >
  31. </template>
  32. </el-table-column>
  33. </dilTable>
  34. </div>
  35. </div>
  36. </template>
  37. <script>
  38. export default {
  39. data() {
  40. return {
  41. // 框计算的输入框的值
  42. inputText: "",
  43. // 表格渲染的表头及数据
  44. option: {
  45. requestUrl: "/api/v1/rms/getAllLineDesk?apiId=249",
  46. },
  47. countNumber: 0,
  48. };
  49. },
  50. methods: {
  51. initialization(lineId, num) {
  52. this.axios
  53. .post("/api/v1/rms/getCountNumber?lineId=" + lineId)
  54. .then((res) => {
  55. if (res.data.code == "200") {
  56. if (res.data.data > 0) {
  57. this.$message({
  58. showClose: true,
  59. message: "此路线已经和运输订单关联,不能进行修改!",
  60. type: "warning",
  61. });
  62. } else {
  63. if (num == 2) {
  64. this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
  65. confirmButtonText: "确定",
  66. cancelButtonText: "取消",
  67. type: "warning",
  68. })
  69. .then(() => {
  70. this.axios
  71. .post("/api/v1/rms/updateRmsLine", { lineId: lineId })
  72. .then((res) => {
  73. if ((res.data.code = "200")) {
  74. this.$message({
  75. type: "success",
  76. message: "删除成功!",
  77. });
  78. this.$router.go(0);
  79. }
  80. });
  81. })
  82. .catch(() => {
  83. this.$message({
  84. type: "info",
  85. message: "已取消删除",
  86. });
  87. });
  88. } else if (num == 1) {
  89. this.$router.push({
  90. path: "/transitRouteAdd/" + lineId,
  91. });
  92. }
  93. }
  94. }
  95. });
  96. },
  97. // 框计算查询按钮
  98. onclick() {
  99. this.option.requestUrl =
  100. "/api/v1/rms/getAllLineDesk?apiId=249&con=" + this.inputText;
  101. },
  102. // 跳转新增运输路线页面
  103. AddClick() {
  104. this.$router.push({
  105. path: "/transitRouteAdd/0",
  106. });
  107. },
  108. //跳转修改界面
  109. transitRouteUpdata(lineId) {
  110. this.initialization(lineId, 1);
  111. },
  112. //删除本条运输路线
  113. transitRouteDelete(lineId) {
  114. this.initialization(lineId, 2);
  115. },
  116. },
  117. };
  118. </script>
  119. <style lang="scss" scoped>
  120. .transitRoute {
  121. .top {
  122. width: 100%;
  123. height: 100px;
  124. display: flex;
  125. align-items: center;
  126. padding-left: 60px;
  127. }
  128. }
  129. </style>
  130. <style lang="scss" scode>
  131. .steel_inbound{
  132. .top{
  133. display: flex;
  134. width: 30%;
  135. }
  136. }
  137. </style>