addGroupDetail.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <div>
  3. <add-btn ref="add" :rowData="rowData" v-if="tool.checkAuth($route.name,'insert')" :disabled="disabled" @onSuccess="getDetail" style="margin-bottom:16px" />
  4. <tableLayout :layout="tablecols" :data="list" :opwidth="200" :custom="true" height="40vh" fixedName="operation">
  5. <template v-slot:customcol="scope">
  6. <span v-if="scope.column.data[scope.column.columnname]">{{scope.column.data[scope.column.columnname]}}</span>
  7. <span v-else-if="scope.column.columnname != 'operation'">--</span>
  8. </template>
  9. <template v-slot:opreation="scope">
  10. <div >
  11. <Del type="detail" v-if="tool.checkAuth($route.name,'delete')" :id="rowData.sa_itemgroupid" @deleteSuccess="getDetail" :detailId="scope.data.sa_itemgroupmxid"/>
  12. <!-- <editBtn v-if="tool.checkAuth($route.name,'update')" :id="rowData.sa_itemgroupid" @onSuccess="getDetail" :rowData="scope.data"/> -->
  13. </div>
  14. </template>
  15. </tableLayout>
  16. <el-pagination
  17. background
  18. small
  19. @size-change="handleSizeChange"
  20. @current-change="handleCurrentChange"
  21. :current-page="params.content.pageNumber"
  22. :page-size="params.content.pageSize"
  23. layout="total, prev, pager, next, jumper"
  24. :total="total">
  25. </el-pagination>
  26. </div>
  27. </template>
  28. <script>
  29. import AddBtn from './addGroupDetailBtn'
  30. import editBtn from './editGroupDetailBtn'
  31. import { log } from '@antv/g2plot/lib/utils'
  32. import Del from './delete'
  33. export default {
  34. data () {
  35. return {
  36. list:[],
  37. form: {
  38. product:[]
  39. },
  40. tablecols:[],
  41. rules: {
  42. product: [
  43. { required: true, message: '请选择商品', trigger: 'blur' },
  44. ],
  45. },
  46. params: {
  47. "id": "20220923101603",
  48. "version":1,
  49. "content": {
  50. "sa_itemgroupid":"",
  51. "pageNumber":1,
  52. "pageSize":20
  53. }
  54. },
  55. total:0
  56. }
  57. },
  58. props:['rowData','disabled'],
  59. components:{AddBtn,Del,editBtn},
  60. watch: {
  61. },
  62. created() {
  63. this.getDetail()
  64. this.tablecols = this.tool.tabelCol(this.$route.name).groupDetailTable.tablecols
  65. },
  66. methods: {
  67. async getDetail() {
  68. this.params.content.sa_itemgroupid = this.rowData.sa_itemgroupid
  69. let res = await this.$api.requested(this.params)
  70. this.list = res.data
  71. this.total = res.total
  72. console.log(res,'列表数据',this.params);
  73. },
  74. handleClose(tag) {
  75. this.form.tag.splice(this.form.tag.indexOf(tag), 1);
  76. },
  77. handleSizeChange(val) {
  78. // console.log(`每页 ${val} 条`);
  79. this.params.content.pageSize = val
  80. this.getDetail()
  81. },
  82. handleCurrentChange(val) {
  83. // console.log(`当前页: ${val}`);
  84. this.params.content.pageNumber = val
  85. this.getDetail()
  86. },
  87. }
  88. }
  89. </script>
  90. <style scoped>
  91. /deep/.el-dialog__body {
  92. padding-top: 10px !important;
  93. }
  94. /deep/.dialog-footer {
  95. margin-top: 10px !important;
  96. }
  97. /deep/.el-form-item__content {
  98. width: calc(100% - 100px) !important;
  99. }
  100. /deep/.el-select {
  101. width: 100% !important;
  102. }
  103. /deep/.el-form-item {
  104. width: 100% !important;
  105. }
  106. /deep/.el-input{
  107. width: 100% !important;
  108. }
  109. /deep/.el-pagination {
  110. text-align: right;
  111. margin-top: 10px;
  112. margin-right: 40px;
  113. }
  114. </style>