dealCommodity.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <template>
  2. <div>
  3. <el-table
  4. :data="commodityList"
  5. style="width: 100%">
  6. <!--拍卖物标题-->
  7. <el-table-column
  8. prop="cname"
  9. label="拍卖物标题"
  10. width="200"
  11. align='center'>
  12. </el-table-column>
  13. <el-table-column
  14. prop="uname"
  15. label="拍卖用户"
  16. width="100"
  17. align='center'>
  18. </el-table-column>
  19. <!--价格-->
  20. <el-table-column
  21. prop="price"
  22. label="初始价格"
  23. width="80"
  24. align='center'>
  25. </el-table-column>
  26. <!--每次加价-->
  27. <el-table-column
  28. prop="addprice"
  29. label="每次加价"
  30. width="80"
  31. align='center'>
  32. </el-table-column>
  33. <el-table-column
  34. label="创建时间"
  35. width="160"
  36. align='center'>
  37. <template slot-scope="scope">
  38. <!--<i class="el-icon-time"></i>-->
  39. <span style="margin-left: 10px">{{ scope.row.createTime }}</span>
  40. </template>
  41. </el-table-column>
  42. <el-table-column
  43. label="开始时间"
  44. width="160"
  45. align='center'>
  46. <template slot-scope="scope">
  47. <!--<i class="el-icon-time"></i>-->
  48. <span style="margin-left: 10px">{{ scope.row.beginTime }}</span>
  49. </template>
  50. </el-table-column>
  51. <el-table-column
  52. label="结束时间"
  53. width="160"
  54. align='center'>
  55. <template slot-scope="scope">
  56. <!--<i class="el-icon-time"></i>-->
  57. <span style="margin-left: 10px">{{ scope.row.endTime }}</span>
  58. </template>
  59. </el-table-column>
  60. <!--类型-->
  61. <el-table-column
  62. prop="typeId"
  63. label="类型"
  64. width="150"
  65. align='center'>
  66. </el-table-column>
  67. <el-table-column label="审核" width="200" align='center'>
  68. <template slot-scope="scope">
  69. <el-button
  70. size="mini"
  71. @click="check(scope.$index, scope.row,0)">通过</el-button>
  72. <el-button
  73. size="mini"
  74. type="danger"
  75. @click="check(scope.$index, scope.row,-2)">不通过</el-button>
  76. </template>
  77. </el-table-column>
  78. </el-table>
  79. </div>
  80. </template>
  81. <script>
  82. export default {
  83. name: "dealCommodity",
  84. data() {
  85. return {
  86. commodityList: []
  87. }
  88. },
  89. inject: ['reload'],
  90. created() {
  91. this.getNotDealCommodity();
  92. },
  93. methods: {
  94. getNotDealCommodity(){
  95. this.$axios({
  96. url: 'commodity/notDeal',
  97. methods: 'get',
  98. }).then(res => {
  99. if(res.data.code === 200) {
  100. this.commodityList = res.data.data;
  101. }
  102. })
  103. },
  104. check(index, row, status) {
  105. this.$axios({
  106. url:'commodity/changeStatu',
  107. methods: 'get',
  108. params: {
  109. cid: row.cid,
  110. statu: status
  111. }
  112. }).then(res => {
  113. if(res.data.code === 200) {
  114. alert("审核成功");
  115. this.$router.go(0);
  116. }
  117. })
  118. }
  119. }
  120. }
  121. </script>
  122. <style scoped>
  123. </style>