|  |  |  | 
|---|
|  |  |  | <!-- eslint-disable vue/no-use-v-if-with-v-for --> | 
|---|
|  |  |  | <template> | 
|---|
|  |  |  | <div class="table-view"> | 
|---|
|  |  |  | <el-table | 
|---|
|  |  |  | 
|---|
|  |  |  | :summary-method="getSummaries" | 
|---|
|  |  |  | :span-method="arraySpanMethod" | 
|---|
|  |  |  | @selection-change="handleSelectionChange" | 
|---|
|  |  |  | :header-cell-style="{ background: '#f1f3f8', color: '#000009' , 'font-size': '12px','font-family':'PingFangSC'}" | 
|---|
|  |  |  | :header-cell-style="{ background: '#f1f3f8', color: '#000009', 'font-size': '12px', 'font-family': 'PingFangSC' }" | 
|---|
|  |  |  | size="mini" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <el-table-column v-if="tableList.selectIndex" type="index" label="序号" width="50"></el-table-column> | 
|---|
|  |  |  | <el-table-column v-if="selectBox" type="selection" width="40"> </el-table-column> | 
|---|
|  |  |  | <el-table-column | 
|---|
|  |  |  | v-for="(item, i) in tableList.tableColumn" | 
|---|
|  |  |  | 
|---|
|  |  |  | <div v-else-if="item.isProductName" class="product-view"> | 
|---|
|  |  |  | <ul v-if="scope.row.products && scope.row.products.length > 0"> | 
|---|
|  |  |  | <li v-for="(item, index) in scope.row.products" :key="index"> | 
|---|
|  |  |  | <div :class="scope.row.products.length === 1 ? 'name-view no-bottom' : 'name-view'"> | 
|---|
|  |  |  | <div class="name-view"> | 
|---|
|  |  |  | {{ item.name }} | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </li> | 
|---|
|  |  |  | 
|---|
|  |  |  | <div v-else-if="item.isProductAmount" class="product-view"> | 
|---|
|  |  |  | <ul v-if="scope.row.products && scope.row.products.length > 0"> | 
|---|
|  |  |  | <li v-for="(item, index) in scope.row.products" :key="index"> | 
|---|
|  |  |  | <div :class="scope.row.products.length === 1 ? 'name-view no-bottom' : 'name-view'"> | 
|---|
|  |  |  | <div class="name-view"> | 
|---|
|  |  |  | {{ item.amount }} | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </li> | 
|---|
|  |  |  | 
|---|
|  |  |  | <div v-else-if="item.isProductPrice" class="product-view"> | 
|---|
|  |  |  | <ul v-if="scope.row.products && scope.row.products.length > 0"> | 
|---|
|  |  |  | <li v-for="(item, index) in scope.row.products" :key="index"> | 
|---|
|  |  |  | <div :class="scope.row.products.length === 1 ? 'name-view no-bottom' : 'name-view'"> | 
|---|
|  |  |  | <div class="name-view"> | 
|---|
|  |  |  | {{ item.price }} | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </li> | 
|---|
|  |  |  | 
|---|
|  |  |  | <div v-else-if="item.isProductTotal" class="product-view"> | 
|---|
|  |  |  | <ul v-if="scope.row.products && scope.row.products.length > 0"> | 
|---|
|  |  |  | <li v-for="(item, index) in scope.row.products" :key="index"> | 
|---|
|  |  |  | <div :class="scope.row.products.length === 1 ? 'name-view no-bottom' : 'name-view'"> | 
|---|
|  |  |  | <div class="name-view"> | 
|---|
|  |  |  | {{ item.total }} | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </li> | 
|---|
|  |  |  | 
|---|
|  |  |  | <div class="overSpread1" v-show="iscolopen" @click="onMaskClick"></div> | 
|---|
|  |  |  | <div class="styleBtn"> | 
|---|
|  |  |  | <i @click="checkCol()" class="label">...</i> | 
|---|
|  |  |  | <el-checkbox-group | 
|---|
|  |  |  | v-model="showcol" | 
|---|
|  |  |  | v-show="iscolopen" | 
|---|
|  |  |  | class="checkbox-group" | 
|---|
|  |  |  | @change="selectCheckBoxList" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <el-checkbox v-for="item in tableList.allcol" :label="item" :key="item" | 
|---|
|  |  |  | >{{ item }} | 
|---|
|  |  |  | </el-checkbox> | 
|---|
|  |  |  | <el-checkbox-group v-model="showcol" v-show="iscolopen" class="checkbox-group" @change="selectCheckBoxList"> | 
|---|
|  |  |  | <el-checkbox v-for="item in tableList.allcol" :label="item" :key="item">{{ item }} </el-checkbox> | 
|---|
|  |  |  | </el-checkbox-group> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | 
|---|
|  |  |  | props: { | 
|---|
|  |  |  | selectBox: { | 
|---|
|  |  |  | type: Boolean, | 
|---|
|  |  |  | default: true | 
|---|
|  |  |  | default: false | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | tableList: { | 
|---|
|  |  |  | type: Object, | 
|---|
|  |  |  | default: () => { | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | selectBox: true, | 
|---|
|  |  |  | selectIndex: true, | 
|---|
|  |  |  | tableInfomation: [], // 接口返回数据 | 
|---|
|  |  |  | showcol: [], | 
|---|
|  |  |  | allcol: [], | 
|---|
|  |  |  | 
|---|
|  |  |  | data() { | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | iscolopen: false, | 
|---|
|  |  |  | showcol:[] | 
|---|
|  |  |  | showcol: [] | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | computed: {}, | 
|---|
|  |  |  | watch: { | 
|---|
|  |  |  | 'tableList.showcol':{ | 
|---|
|  |  |  | handler(newVal){ | 
|---|
|  |  |  | this.showcol=newVal | 
|---|
|  |  |  | "tableList.showcol": { | 
|---|
|  |  |  | handler(newVal) { | 
|---|
|  |  |  | this.showcol = newVal | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | immediate:true | 
|---|
|  |  |  | immediate: true | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | onMaskClick() { | 
|---|
|  |  |  | this.iscolopen = false; | 
|---|
|  |  |  | this.iscolopen = false | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | checkCol() { | 
|---|
|  |  |  | this.iscolopen = !this.iscolopen; | 
|---|
|  |  |  | this.iscolopen = !this.iscolopen | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | selectCheckBoxList(val) { | 
|---|
|  |  |  | this.$emit("selTableCol", val); | 
|---|
|  |  |  | this.$emit("selTableCol", val) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | handleReserve(row) { | 
|---|
|  |  |  | return row._id ? row._id : row.id | 
|---|
|  |  |  | 
|---|
|  |  |  | for (let i = 0; i < this.showSummary.mergeNumber; i++) { | 
|---|
|  |  |  | cell[i] && cell[i].style && (cell[i].style.display = "none") | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (cell[this.showSummary.mergeNumber]){ | 
|---|
|  |  |  | if (cell[this.showSummary.mergeNumber].classList){ | 
|---|
|  |  |  | if (cell[this.showSummary.mergeNumber]) { | 
|---|
|  |  |  | if (cell[this.showSummary.mergeNumber].classList) { | 
|---|
|  |  |  | cell[this.showSummary.mergeNumber].classList.remove("is-left") | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (cell[this.showSummary.mergeNumber].colSpan){ | 
|---|
|  |  |  | if (cell[this.showSummary.mergeNumber].colSpan) { | 
|---|
|  |  |  | cell[this.showSummary.mergeNumber].colSpan = this.showSummary.mergeNumber.toString() | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | margin-left: -10px; | 
|---|
|  |  |  | margin-right: -11px; | 
|---|
|  |  |  | li { | 
|---|
|  |  |  | //height: 57px; | 
|---|
|  |  |  | //line-height: 57px; | 
|---|
|  |  |  | height: 22px; | 
|---|
|  |  |  | line-height: 22px; | 
|---|
|  |  |  | .name-view { | 
|---|
|  |  |  | padding-left: 10px; | 
|---|
|  |  |  | border-bottom: 1px solid #ebeef5; | 
|---|
|  |  |  | 
|---|
|  |  |  | border-bottom: 0; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .no-product { | 
|---|
|  |  |  | //height: 57px; | 
|---|
|  |  |  | //line-height: 57px; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | li:last-child .name-view{ | 
|---|
|  |  |  | li:last-child .name-view { | 
|---|
|  |  |  | border-bottom: none; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .no-product { | 
|---|
|  |  |  | height: 22px; | 
|---|
|  |  |  | line-height: 22px; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | ::v-deep { | 
|---|
|  |  |  | .el-table__footer-wrapper { | 
|---|
|  |  |  | 
|---|
|  |  |  | text-align: center; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ::v-deep{ | 
|---|
|  |  |  | .el-table .cell .el-button--text.el-button--small{ | 
|---|
|  |  |  | ::v-deep { | 
|---|
|  |  |  | .el-table .cell .el-button--text.el-button--small { | 
|---|
|  |  |  | padding: 4px 0; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | .checkbox-group { | 
|---|
|  |  |  | width: 160px; | 
|---|
|  |  |  | height: 330px; | 
|---|
|  |  |  | height: 300px; | 
|---|
|  |  |  | overflow: auto; | 
|---|
|  |  |  | display: flex; | 
|---|
|  |  |  | flex-direction: column; | 
|---|