transPrice.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template>
  2. <!-- 内转汽运单价页面 -->
  3. <div class="salePlan">
  4. <div class="top">
  5. <el-input placeholder="请输入内容" v-model="input" clearable> </el-input>
  6. <el-button type="primary" class="btn" @click="onclick" :loading="loading">
  7. <i class="el-icon-search"></i>查询
  8. </el-button>
  9. <el-button type="primary" @click="btnclick(0)">
  10. <i class="el-icon-plus"></i>新增
  11. </el-button>
  12. <el-button type="primary" @click="exportData()"
  13. ><i class="el-icon-download"></i>导出(Excel)</el-button
  14. >
  15. </div>
  16. <div class="table">
  17. <el-tabs v-model="activeName">
  18. <!-- 正在启用 -->
  19. <el-tab-pane label="正在启用" name="first">
  20. <dilTable
  21. ref="excelDom"
  22. v-bind.sync="option"
  23. :loading="loading"
  24. :isKuang="isKuang"
  25. @func="func"
  26. >
  27. <el-table-column label="操作" width="120px" fixed="right">
  28. <template slot-scope="scope">
  29. <el-button type="text" @click="updatePriceMaterial(scope.row)">
  30. 修改价格物资
  31. </el-button>
  32. </template>
  33. </el-table-column>
  34. </dilTable>
  35. </el-tab-pane>
  36. <!-- 历史启用 -->
  37. <el-tab-pane label="历史启用" name="second">
  38. <dilTable
  39. v-bind.sync="option2"
  40. :loading="loading"
  41. :isKuang="isKuang"
  42. @func="func"
  43. >
  44. </dilTable>
  45. </el-tab-pane>
  46. </el-tabs>
  47. </div>
  48. </div>
  49. </template>
  50. <script>
  51. export default {
  52. name: "TransportPrice",
  53. data() {
  54. return {
  55. activeName: "first",
  56. isKuang: false,
  57. loading: false,
  58. input: "",
  59. option: {
  60. // 表格请求数据的地址
  61. requestUrl: "/api/v1/ams/getInwardContractPrice?apiId=464&deleted=0"
  62. },
  63. option2: {
  64. // 表格请求数据的地址
  65. requestUrl: "/api/v1/ams/getInwardContractPrice?apiId=464&deleted=1"
  66. },
  67. tableTitle: "汽运单价"
  68. };
  69. },
  70. methods: {
  71. updatePriceMaterial(row) {
  72. // 修改运价
  73. // console.log(row);
  74. // this.$router.push("/updateTransPrice/" +row);
  75. this.$router.push({ name: "updateTransPrice", query:{row:row||undefined}})
  76. },
  77. func() {
  78. this.loading = false;
  79. this.isKuang = false;
  80. },
  81. onclick() {
  82. this.loading = true;
  83. this.isKuang = true;
  84. if (this.input) {
  85. this.option.requestUrl =
  86. "/api/v1/ams/getInwardContractPrice?apiId=464&con=" + this.input;
  87. } else {
  88. this.option.requestUrl =
  89. "/api/v1/ams/getInwardContractPrice?apiId=464&deleted=0&i=" + new Date();
  90. }
  91. },
  92. btnclick() {
  93. this.$router.push("/inwardAddTransPrice");
  94. }
  95. }
  96. };
  97. </script>
  98. <style lang="scss" scoped>
  99. .salePlan {
  100. .top {
  101. margin-left: 20px;
  102. margin-top: 20px;
  103. .el-input {
  104. width: 20%;
  105. margin-right: 1.25rem;
  106. }
  107. }
  108. .table {
  109. margin-left: 20px;
  110. margin-top: 20px;
  111. }
  112. }
  113. </style>