addGroupDetail.vue 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <template>
  2. <div>
  3. <el-button type="text" size="small" @click="detailBtn">明细</el-button>
  4. <el-dialog title="产品组商品明细" append-to-body :visible.sync="dialogTableVisible" width="70%">
  5. <add-btn ref="add" v-if="tool.checkAuth($route.name,'insert')" @onSuccess="getDetail" style="margin-bottom:16px" :id="rowData.sa_itemgroupid" />
  6. <tableLayout v-if="dialogTableVisible" :layout="tablecols" :data="list" :opwidth="200" :custom="true" height="40vh" fixedName="operation">
  7. <template v-slot:customcol="scope">
  8. <span v-if="scope.column.data[scope.column.columnname]">{{scope.column.data[scope.column.columnname]}}</span>
  9. <span v-else-if="scope.column.columnname != 'operation'">--</span>
  10. </template>
  11. <template v-slot:opreation="scope">
  12. <div style="display:flex;justify-content:space-around">
  13. <Del type="detail" v-if="tool.checkAuth($route.name,'delete')" :id="rowData.sa_itemgroupid" @deleteSuccess="getDetail" :detailId="scope.data.sa_itemgroupmxid"/>
  14. <!-- <editBtn v-if="tool.checkAuth($route.name,'update')" :id="rowData.sa_itemgroupid" @onSuccess="getDetail" :rowData="scope.data"/> -->
  15. </div>
  16. </template>
  17. </tableLayout>
  18. </el-dialog>
  19. </div>
  20. </template>
  21. <script>
  22. import AddBtn from './addGroupDetailBtn'
  23. import editBtn from './editGroupDetailBtn'
  24. import { log } from '@antv/g2plot/lib/utils'
  25. import Del from './delete'
  26. export default {
  27. data () {
  28. return {
  29. dialogTableVisible:false,
  30. list:[],
  31. form: {
  32. product:[]
  33. },
  34. tablecols:[],
  35. rules: {
  36. product: [
  37. { required: true, message: '请选择商品', trigger: 'blur' },
  38. ],
  39. }
  40. }
  41. },
  42. props:['rowData'],
  43. components:{AddBtn,Del,editBtn},
  44. watch: {
  45. },
  46. created() {
  47. this.tablecols = this.tool.tabelCol(this.$route.name).groupDetailTable.tablecols
  48. },
  49. methods: {
  50. async getDetail() {
  51. let res = await this.$api.requested({
  52. "id": "20220923101603",
  53. "version":1,
  54. "content": {
  55. "sa_itemgroupid":this.rowData.sa_itemgroupid
  56. }
  57. })
  58. this.list = res.data
  59. },
  60. detailBtn() {
  61. this.getDetail()
  62. this.dialogTableVisible = true
  63. },
  64. handleClose(tag) {
  65. this.form.tag.splice(this.form.tag.indexOf(tag), 1);
  66. },
  67. }
  68. }
  69. </script>
  70. <style scoped>
  71. /deep/.el-dialog__body {
  72. padding-top: 10px !important;
  73. }
  74. /deep/.dialog-footer {
  75. margin-top: 10px !important;
  76. }
  77. /deep/.el-form-item__content {
  78. width: calc(100% - 100px) !important;
  79. }
  80. /deep/.el-select {
  81. width: 100% !important;
  82. }
  83. /deep/.el-form-item {
  84. width: 100% !important;
  85. }
  86. /deep/.el-input{
  87. width: 100% !important;
  88. }
  89. </style>