Commit 2c3237cf by cwq0219

表格-空数据

1 parent 88dc112f
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</div> </div>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<GLTable ref="classifyRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn"> <GLTable ref="classifyRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div class="table-btns" slot="auth-button" slot-scope="scope"> <div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleEdit(2, scope.scope)">编辑</el-button> <el-button type="text" @click="handleEdit(2, scope.scope)">编辑</el-button>
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button> <el-button type="text" @click="handleDelete(scope.scope)">删除</el-button>
...@@ -132,6 +132,11 @@ export default { ...@@ -132,6 +132,11 @@ export default {
handleTop(row) { handleTop(row) {
this.secondConfirm('置顶', '确定置顶此分类?', 'classifyList', 'topClassifyApi', { id: row.id }) this.secondConfirm('置顶', '确定置顶此分类?', 'classifyList', 'topClassifyApi', { id: row.id })
}, },
setTableFinishFun() {
//接收到的数据为空
this.$refs.classifyRef.data.length ? (this.$refs.classifyRef.tableHeightValues = '') : this.$refs.classifyRef.setTableHeightFun()
},
handleSearch() { handleSearch() {
this.$refs.classifyRef.refreshTable() this.$refs.classifyRef.refreshTable()
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</div> </div>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<GLTable ref="commentRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn"> <GLTable ref="commentRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div class="table-btns" slot="auth-button" slot-scope="scope"> <div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button v-if="scope.scope.commentStatus == '0'" type="text" @click="handleRevoke(scope.scope)">发布</el-button> <el-button v-if="scope.scope.commentStatus == '0'" type="text" @click="handleRevoke(scope.scope)">发布</el-button>
<el-button v-if="scope.scope.commentStatus == '1'" type="text" @click="handleRevoke(scope.scope)">撤回</el-button> <el-button v-if="scope.scope.commentStatus == '1'" type="text" @click="handleRevoke(scope.scope)">撤回</el-button>
...@@ -188,6 +188,11 @@ export default { ...@@ -188,6 +188,11 @@ export default {
}) })
} }
}, },
setTableFinishFun() {
//接收到的数据为空
this.$refs.commentRef.data.length ? (this.$refs.commentRef.tableHeightValues = '') : this.$refs.commentRef.setTableHeightFun()
},
handleSearch() { handleSearch() {
this.$refs.commentRef.refreshTable() this.$refs.commentRef.refreshTable()
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
</el-tabs> </el-tabs>
<!-- 表格区域 - 全部订单/售后订单 - 开始 --> <!-- 表格区域 - 全部订单/售后订单 - 开始 -->
<GLTable ref="allOrderRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn"> <GLTable ref="allOrderRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div class="table-btns" slot="auth-button" slot-scope="scope"> <div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleDetail(scope.scope)">查看订单</el-button> <el-button type="text" @click="handleDetail(scope.scope)">查看订单</el-button>
<el-button v-if="scope.scope.deliveryType == 1 && scope.scope.orderStatus == 14" type="text" @click="handleWriteOff(scope.scope)">订单核销</el-button> <el-button v-if="scope.scope.deliveryType == 1 && scope.scope.orderStatus == 14" type="text" @click="handleWriteOff(scope.scope)">订单核销</el-button>
...@@ -614,6 +614,11 @@ export default { ...@@ -614,6 +614,11 @@ export default {
}) })
}, },
// 确认收货 - end // 确认收货 - end
setTableFinishFun() {
//接收到的数据为空
this.$refs.allOrderRef.data.length ? (this.$refs.allOrderRef.tableHeightValues = '') : this.$refs.allOrderRef.setTableHeightFun()
},
handleSearch() { handleSearch() {
this.$refs.allOrderRef.refreshTable() this.$refs.allOrderRef.refreshTable()
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</div> </div>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<GLTable ref="shareRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn"> <GLTable ref="shareRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div class="table-btns" slot="auth-button" slot-scope="scope"> <div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button v-if="scope.scope.shareStatus == 0" type="text" @click="handleEdit(2, scope.scope)">发布</el-button> <el-button v-if="scope.scope.shareStatus == 0" type="text" @click="handleEdit(2, scope.scope)">发布</el-button>
<el-button v-if="scope.scope.shareStatus == 1" type="text" @click="handleRevoke(scope.scope)">撤回</el-button> <el-button v-if="scope.scope.shareStatus == 1" type="text" @click="handleRevoke(scope.scope)">撤回</el-button>
...@@ -205,6 +205,11 @@ export default { ...@@ -205,6 +205,11 @@ export default {
}) })
} }
}, },
setTableFinishFun() {
//接收到的数据为空
this.$refs.shareRef.data.length ? (this.$refs.shareRef.tableHeightValues = '') : this.$refs.shareRef.setTableHeightFun()
},
handleSearch() { handleSearch() {
this.$refs.shareRef.refreshTable() this.$refs.shareRef.refreshTable()
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</div> </div>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<GLTable ref="proGroupRef" class="table-img" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn"> <GLTable ref="proGroupRef" class="table-img" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div slot="goodsImage" class="table-image" slot-scope="scope"> <div slot="goodsImage" class="table-image" slot-scope="scope">
<img class="img-60" :src="scope.scope.goodsImage" /> <img class="img-60" :src="scope.scope.goodsImage" />
</div> </div>
...@@ -131,7 +131,7 @@ export default { ...@@ -131,7 +131,7 @@ export default {
name: 'retailPrice', name: 'retailPrice',
width: '180', width: '180',
formatter: cellValue => { formatter: cellValue => {
return (cellValue.retailPrice / 100).toFixed(2) return cellValue.retailPrice
} }
}, },
{ {
...@@ -303,6 +303,40 @@ export default { ...@@ -303,6 +303,40 @@ export default {
}) })
} }
}, },
setTableFinishFun() {
//接收到的数据为空
if (!this.$refs.proGroupRef.data.length) {
this.$refs.proGroupRef.setTableHeightFun()
} else {
this.$refs.proGroupRef.tableHeightValues = ''
this.$refs.proGroupRef.data.forEach(item => {
item.saleAmount = item.goodsStatistics.saleAmount
if (item.specificationDetailList.length > 1) {
let retailPriceList = item.specificationDetailList.sort(function(a, b) {
return a.retailPrice - b.retailPrice
})
let stockeList = item.specificationDetailList.sort(function(a, b) {
return a.stock - b.stock
})
let minRatilPrice = retailPriceList[0].retailPrice / 100
let maxRatilPrice = retailPriceList[retailPriceList.length - 1].retailPrice / 100
let minStock = stockeList[0].stock
let maxStock = stockeList[stockeList.length - 1].stock
item.retailPrice = minRatilPrice == maxRatilPrice ? minRatilPrice.toFixed(2) : minRatilPrice.toFixed(2) + '-' + maxRatilPrice.toFixed(2)
item.minRatilPrice = minRatilPrice.toFixed(2)
item.goodsStock = minStock == maxStock ? minStock : minStock + '-' + maxStock
} else if (item.specificationDetailList.length == 1) {
item.retailPrice = (item.specificationDetailList[0].retailPrice / 100).toFixed(2)
item.minRatilPrice = item.retailPrice
item.goodsStock = item.specificationDetailList[0].stock
} else {
item.retailPrice = (item.retailPrice / 100).toFixed(2)
item.minRatilPrice = item.retailPrice
}
})
}
},
handleSearch() { handleSearch() {
this.$refs.proGroupRef.refreshTable() this.$refs.proGroupRef.refreshTable()
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</div> </div>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<GLTable ref="proGroupRef" class="table-img" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn"> <GLTable ref="proGroupRef" class="table-img" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<template slot="goodsImage" slot-scope="scope"> <template slot="goodsImage" slot-scope="scope">
<img class="img-60" :src="scope.scope.goodsImage" /> <img class="img-60" :src="scope.scope.goodsImage" />
</template> </template>
...@@ -135,7 +135,7 @@ export default { ...@@ -135,7 +135,7 @@ export default {
name: 'retailPrice', name: 'retailPrice',
width: '180', width: '180',
formatter: cellValue => { formatter: cellValue => {
return (cellValue.retailPrice / 100).toFixed(2) return cellValue.retailPrice
} }
}, },
{ {
...@@ -336,6 +336,40 @@ export default { ...@@ -336,6 +336,40 @@ export default {
}) })
} }
}, },
setTableFinishFun() {
//接收到的数据为空
if (!this.$refs.proGroupRef.data.length) {
this.$refs.proGroupRef.setTableHeightFun()
} else {
this.$refs.proGroupRef.tableHeightValues = ''
this.$refs.proGroupRef.data.forEach(item => {
item.saleAmount = item.goodsStatistics.saleAmount
if (item.specificationDetailList.length > 1) {
let retailPriceList = item.specificationDetailList.sort(function(a, b) {
return a.retailPrice - b.retailPrice
})
let stockeList = item.specificationDetailList.sort(function(a, b) {
return a.stock - b.stock
})
let minRatilPrice = retailPriceList[0].retailPrice / 100
let maxRatilPrice = retailPriceList[retailPriceList.length - 1].retailPrice / 100
let minStock = stockeList[0].stock
let maxStock = stockeList[stockeList.length - 1].stock
item.retailPrice = minRatilPrice == maxRatilPrice ? minRatilPrice.toFixed(2) : minRatilPrice.toFixed(2) + '-' + maxRatilPrice.toFixed(2)
item.minRatilPrice = minRatilPrice.toFixed(2)
item.goodsStock = minStock == maxStock ? minStock : minStock + '-' + maxStock
} else if (item.specificationDetailList.length == 1) {
item.retailPrice = (item.specificationDetailList[0].retailPrice / 100).toFixed(2)
item.minRatilPrice = item.retailPrice
item.goodsStock = item.specificationDetailList[0].stock
} else {
item.retailPrice = (item.retailPrice / 100).toFixed(2)
item.minRatilPrice = item.retailPrice
}
})
}
},
handleSearch() { handleSearch() {
this.$refs.proGroupRef.refreshTable() this.$refs.proGroupRef.refreshTable()
......
...@@ -129,6 +129,8 @@ export default { ...@@ -129,6 +129,8 @@ export default {
this.tableParams.checkSelectVal.push(item.goodsId) this.tableParams.checkSelectVal.push(item.goodsId)
} }
}) })
//接收到的数据为空
this.$refs.takeGoodRef.data.length ? (this.$refs.takeGoodRef.tableHeightValues = '') : this.$refs.takeGoodRef.setTableHeightFun()
}, },
secondConfirm(title, txt, apiModule, apiName, apiParams, fn) { secondConfirm(title, txt, apiModule, apiName, apiParams, fn) {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
</div> </div>
<!-- 表格区域 开始 --> <!-- 表格区域 开始 -->
<GLTable ref="zoneRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn"> <GLTable ref="zoneRef" :getListApi="getListApi" :searchForm="tableSearchForm" :tableParams="tableParams" :pageConf="pageConf" :beforeSearchFn="beforeSearchFn" @setTableFinishFun="setTableFinishFun">
<div class="table-btns" slot="auth-button" slot-scope="scope"> <div class="table-btns" slot="auth-button" slot-scope="scope">
<el-button type="text" @click="handleEdit(2, scope.scope)">编辑</el-button> <el-button type="text" @click="handleEdit(2, scope.scope)">编辑</el-button>
<el-button type="text" @click="handleDelete(scope.scope)">删除</el-button> <el-button type="text" @click="handleDelete(scope.scope)">删除</el-button>
...@@ -128,6 +128,11 @@ export default { ...@@ -128,6 +128,11 @@ export default {
handleDelete(row) { handleDelete(row) {
this.secondConfirm('删除', '是否确认删除该专区?', 'zoneList', 'deleteZoneApi', { id: row.id }) this.secondConfirm('删除', '是否确认删除该专区?', 'zoneList', 'deleteZoneApi', { id: row.id })
}, },
setTableFinishFun() {
//接收到的数据为空
this.$refs.zoneRef.data.length ? (this.$refs.zoneRef.tableHeightValues = '') : this.$refs.zoneRef.setTableHeightFun()
},
handleSearch() { handleSearch() {
this.$refs.zoneRef.refreshTable() this.$refs.zoneRef.refreshTable()
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!