| | |
| | | <template> |
| | | <GlobalWindow |
| | | :title="title" |
| | | width="80%" |
| | | width="100%" |
| | | :with-footer="false" |
| | | :visible.sync="visible" |
| | | @confirm="confirm" |
| | | > |
| | | <TableLayout :permissions="['business:goods:query']"> |
| | | <TableLayout> |
| | | <!-- 搜索表单 --> |
| | | <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" style="display: block;" > |
| | | <el-form ref="searchForm" slot="search-form" id="curSearchForm" :model="searchForm" label-width="100px" style="display: block;" > |
| | | <el-form-item label="" prop="name" label-width="5px" style="display: inline-block;margin-right: 30px;"> |
| | | <el-input v-model="searchForm.name" style="width: 150px;" placeholder="商品名称" clearable @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | |
| | | <section> |
| | | <el-button type="primary" @click="search">搜索</el-button> |
| | | <el-button @click="reset">重置</el-button> |
| | | <el-button type="primary" style="margin-left: 30px;font-weight: bold" @click="confirm">确认商品配置</el-button> |
| | | </section> |
| | | </el-form> |
| | | <!-- 表格和分页 --> |
| | | <template v-slot:table-wrap> |
| | | <div :style="'display: flex;height:'+tabelHeight+'px;'"> |
| | | <div :style="'display: flex;height:'+tableHeight+'px;'"> |
| | | <div style="flex: 6;"> |
| | | <ul class="toolbar"> |
| | | <li><el-button type="primary" icon="el-icon-plus" @click="addAll()" :disabled="!(tableData.selectedRows && tableData.selectedRows.length)">批量添加</el-button></li> |
| | | </ul> |
| | | <el-table |
| | | ref="singleTable" |
| | | :height="tabelHeight-80" |
| | | :height="tableHeight-80" |
| | | v-loading="isWorking.search" |
| | | :data="tableData.list" |
| | | stripe |
| | |
| | | <div style="flex: 6"> <span>已选择<i class="blue" style="margin: 0 10px">{{selectGoods.length||0}}</i>件商品</span></div> |
| | | <div style="flex: 1;text-align: right"> <el-button size="mini" type="danger" class="blue" @click="cleanAll">清空</el-button></div> |
| | | </div> |
| | | <div :style="`display: flex;flex-direction: column;max-height: ${tabelHeight-80}px;overflow: auto`"> |
| | | <div :style="`display: flex;flex-direction: column;max-height: ${tableHeight-80}px;overflow: auto`"> |
| | | <div v-for="(item,index) in selectGoods" style="display: flex;margin: 10px 0;" :key="'selGoods'+item.id"> |
| | | <div style="flex: 6">{{item.name}}<br><span class="red">¥{{item.skuPrice || 0}}</span></div> |
| | | <div style="flex: 1;text-align: right;"> |
| | |
| | | components: { GlobalWindow, TableLayout, Pagination }, |
| | | data () { |
| | | return { |
| | | activeName: 'first', |
| | | title: '', |
| | | visible: false, |
| | | tabelHeight: null, |
| | | selectGoods:[], |
| | | // 搜索 |
| | | searchForm: { |
| | | name: '', |
| | | categoryId: '', |
| | | brandId: '', |
| | | type: '0', // 平台商品 |
| | | status: '', |
| | | isrec: '', |
| | | labels: '' |
| | | id: '', |
| | | bindShopId: '' |
| | | }, |
| | | labels: [], |
| | | serials: [], |
| | | brands: [], |
| | | selectGoods: [] |
| | | shops: [], |
| | | brands:[], |
| | | labels:[] |
| | | } |
| | | }, |
| | | mounted() { |
| | | window.addEventListener('resize', this.handleResize); |
| | | }, |
| | | beforeDestroy() { |
| | | window.removeEventListener('resize', this.handleResize); |
| | | }, |
| | | created () { |
| | | this.config({ |
| | |
| | | .then(res => { |
| | | this.brands = res |
| | | }) |
| | | window.addEventListener('resize', () => { |
| | | this.handleResize() |
| | | }) |
| | | this.handleResize() |
| | | }, |
| | | methods: { |
| | | handleResize(){ |
| | | this.tabelHeight = window.innerHeight - 300 |
| | | handleResize () { |
| | | this.tableHeight = window.innerHeight - 260 |
| | | if (document.getElementById('curSearchForm')) { |
| | | this.tableHeight = this.tableHeight - document.getElementById('curSearchForm').clientHeight |
| | | } |
| | | }, |
| | | checkSelectable (row) { |
| | | return row.tabStatus !== 2 |
| | |
| | | <style scoped> |
| | | .table-pagination{ |
| | | position: fixed !important; |
| | | bottom: 50px; |
| | | bottom: 10px; |
| | | } |
| | | </style> |