| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- <template>
- <div>
- <add-btn ref="add" :rowData="rowData" v-if="tool.checkAuth($route.name,'insert')" :disabled="disabled" @onSuccess="getDetail" style="margin-bottom:16px" />
- <tableLayout :layout="tablecols" :data="list" :opwidth="200" :custom="true" height="40vh" fixedName="operation">
- <template v-slot:customcol="scope">
- <span v-if="scope.column.data[scope.column.columnname]">{{scope.column.data[scope.column.columnname]}}</span>
- <span v-else-if="scope.column.columnname != 'operation'">--</span>
- </template>
- <template v-slot:opreation="scope">
- <div >
- <Del type="detail" v-if="tool.checkAuth($route.name,'delete')" :id="rowData.sa_itemgroupid" @deleteSuccess="getDetail" :detailId="scope.data.sa_itemgroupmxid"/>
- <!-- <editBtn v-if="tool.checkAuth($route.name,'update')" :id="rowData.sa_itemgroupid" @onSuccess="getDetail" :rowData="scope.data"/> -->
- </div>
- </template>
- </tableLayout>
- <el-pagination
- background
- small
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :current-page="params.content.pageNumber"
- :page-size="params.content.pageSize"
- layout="total, prev, pager, next, jumper"
- :total="total">
- </el-pagination>
- </div>
- </template>
- <script>
- import AddBtn from './addGroupDetailBtn'
- import editBtn from './editGroupDetailBtn'
- import { log } from '@antv/g2plot/lib/utils'
- import Del from './delete'
- export default {
- data () {
- return {
- list:[],
- form: {
- product:[]
- },
- tablecols:[],
- rules: {
- product: [
- { required: true, message: '请选择商品', trigger: 'blur' },
- ],
- },
- params: {
- "id": "20220923101603",
- "version":1,
- "content": {
- "sa_itemgroupid":"",
- "pageNumber":1,
- "pageSize":20
- }
- },
- total:0
- }
- },
- props:['rowData','disabled'],
- components:{AddBtn,Del,editBtn},
- watch: {
- },
- created() {
- this.getDetail()
- this.tablecols = this.tool.tabelCol(this.$route.name).groupDetailTable.tablecols
- },
- methods: {
- async getDetail() {
- this.params.content.sa_itemgroupid = this.rowData.sa_itemgroupid
- let res = await this.$api.requested(this.params)
- this.list = res.data
- this.total = res.total
- console.log(res,'列表数据',this.params);
-
- },
- handleClose(tag) {
- this.form.tag.splice(this.form.tag.indexOf(tag), 1);
- },
- handleSizeChange(val) {
- // console.log(`每页 ${val} 条`);
- this.params.content.pageSize = val
- this.getDetail()
- },
- handleCurrentChange(val) {
- // console.log(`当前页: ${val}`);
- this.params.content.pageNumber = val
- this.getDetail()
- },
- }
- }
- </script>
- <style scoped>
- /deep/.el-dialog__body {
- padding-top: 10px !important;
- }
- /deep/.dialog-footer {
- margin-top: 10px !important;
- }
- /deep/.el-form-item__content {
- width: calc(100% - 100px) !important;
- }
- /deep/.el-select {
- width: 100% !important;
- }
- /deep/.el-form-item {
- width: 100% !important;
- }
- /deep/.el-input{
- width: 100% !important;
- }
- /deep/.el-pagination {
- text-align: right;
- margin-top: 10px;
- margin-right: 40px;
- }
- </style>
|