index.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <template>
  2. <div>
  3. <add-sale-class class="normal-margin" @addSuccess="getClassList" v-if="tool.checkAuth($route.name,'add_saleClass')"/>
  4. <tableLayout v-if="saleClassList" :layout="tablecols" :data="saleClassList" :custom="false" height="calc(100vh - 495px)" fixedName="operation">
  5. <template v-slot:opreation="scope">
  6. <Del v-if="tool.checkAuth($route.name,'delete')" :id="scope.data.sys_enterprise_saleclassid" @onSuccess="getClassList"/>
  7. </template>
  8. </tableLayout>
  9. </div>
  10. </template>
  11. <script>
  12. import addSaleClass from './modules/addSaleClass'
  13. import Del from './modules/del'
  14. export default {
  15. name: '',
  16. data() {
  17. return {
  18. saleClassList:'',
  19. tablecols:[]
  20. };
  21. },
  22. components:{addSaleClass,Del},
  23. computed:{
  24. },
  25. watch:{
  26. },
  27. created() {
  28. this.getClassList()
  29. this.tablecols = this.tool.tabelCol(this.$route.name)['saleClassTable'].tablecols
  30. },
  31. methods: {
  32. /* 获取类别数据 */
  33. async getClassList() {
  34. let res = await this.$api.requested({
  35. "id": 20220924134502,
  36. "content": {
  37. "pageNumber": 1,
  38. "pageSize": 20,
  39. "where": {
  40. "condition": ""
  41. }
  42. },
  43. })
  44. console.log(res);
  45. this.saleClassList = res.data
  46. }
  47. },
  48. };
  49. </script>
  50. <style scoped>
  51. </style>