Commit f250698a authored by dragondean@qq.com's avatar dragondean@qq.com

优化商品选择的全选提示

parent 4a08ff17
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
<el-button type="primary" @click="reLoad">{{$t('搜索')}}</el-button> <el-button type="primary" @click="reLoad">{{$t('搜索')}}</el-button>
<div v-if="showAll"> <div v-if="showAll">
<el-checkbox :label="$t('全选(最多500)')" @change="toggleAll" :disabled="isAllProduct"></el-checkbox> <el-checkbox :label="$t('全选') + `(${total > 500 ? $t('最多500') : $t('{total}个', {total})})`" @change="toggleAll" :disabled="isAllProduct"></el-checkbox>
<el-checkbox :label="$t('全选库内商品(共{cnt}个)', {cnt: total})" v-model="isAllProduct"></el-checkbox> <el-checkbox :label="$t('全选库内商品(共{cnt}个)', {cnt: allTotal})" v-model="isAllProduct"></el-checkbox>
</div> </div>
</div> </div>
<div class="list"> <div class="list">
...@@ -61,7 +61,8 @@ export default { ...@@ -61,7 +61,8 @@ export default {
list: [], list: [],
page: 1, page: 1,
pages: 1, pages: 1,
total: 0, // 商品总数 total: 0, // 当前筛选条件的商品总数
allTotal: 0, // 全库商品总数
queryParams: { queryParams: {
pageNo: 1, pageNo: 1,
pageSize: 500, pageSize: 500,
...@@ -115,6 +116,11 @@ export default { ...@@ -115,6 +116,11 @@ export default {
if(this.defaultIds.length){ if(this.defaultIds.length){
this.loadDefaultProds() this.loadDefaultProds()
} }
// 获取全库商品总数
getProductPage({pageNo: 1, pageSize: 1}).then(res => {
this.allTotal = res.data.total
})
}, },
methods: { methods: {
/* setAllProduct(status){ /* setAllProduct(status){
...@@ -209,4 +215,4 @@ export default { ...@@ -209,4 +215,4 @@ export default {
text-overflow: ellipsis; text-overflow: ellipsis;
} }
} }
</style> </style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment