wagonUnLoadEmergency.vue 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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="btnclick(0)">
  7. <i class="el-icon-search"></i>查询
  8. </el-button>
  9. <el-button type="primary" @click="btnclick(1)">
  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="btnclick(2,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. option: {
  39. // 表格请求数据的地址
  40. requestUrl: "/api/v1/tms/getTmstrainWagonUnLoad?apiId=214&resultType=2",
  41. },
  42. input:''
  43. };
  44. },
  45. methods: {
  46. btnclick(num,unloadingId) {
  47. console.log(num,unloadingId)
  48. if ( num == 0 ) {
  49. this.option.requestUrl = '/api/v1/tms/getTmstrainWagonUnLoad?apiId=60&resultType=2&con='+this.input;
  50. } else if (num == 1 ) {
  51. this.$router.push("/addWagonUnLoadEmergency")
  52. }else if (num == 2) {
  53. this.$router.push("/editWagonUnLoadEmergency/" + unloadingId);
  54. }
  55. },
  56. deleteclick(scope) {
  57. let unloadingId = scope;
  58. this.$confirm("是否删除", "提示", {
  59. confirmButtonText: "确定",
  60. cancelButtonText: "取消",
  61. type: "warning",
  62. center: true,
  63. })
  64. .then(() => {
  65. this.$message({
  66. type: "success",
  67. message: "删除成功!",
  68. });
  69. this.axios
  70. .post(
  71. "/api/v1/tms/deleteTmstrainWagonUnLoadResultByUnLoadingId?unloadingId=" +
  72. unloadingId
  73. )
  74. .then(() => {
  75. this.$router.go(0);
  76. });
  77. })
  78. .catch(() => {
  79. this.$message({
  80. type: "info",
  81. message: "取消删除!",
  82. });
  83. });
  84. },
  85. },
  86. };
  87. </script>
  88. <style lang='scss' scoped>
  89. .homeworkPath {
  90. .top {
  91. padding: 1.25rem 1.875rem;
  92. }
  93. }
  94. </style>