销售汇总修改接口

This commit is contained in:
duan 2024-10-17 10:40:44 +08:00
parent c8633cd925
commit 25dfe869f0
3 changed files with 29 additions and 23 deletions

View File

@ -77,7 +77,7 @@ export function tbConsInfoFlowfrmLoss(data) {
// 销售排行榜
export function dateProduct(params) {
return request({
url: '/api/summary/dateProduct',
url: '/api/summary/productSaleDate',
method: 'get',
params
})

View File

@ -69,11 +69,11 @@
</tr>
</thead>
<tbody>
<tr v-for="item in tableList" :key="item.productId">
<td>{{item.productId}}</td>
<tr v-for="(item,index) in tableList" :key="item.productId">
<td>{{++index}}</td>
<td>{{item.productName}}</td>
<td>{{item.productNum}}</td>
<td>{{item.amount}}</td>
<td>{{item.num}}</td>
<td>{{item.salesAmount}}</td>
</tr>
</tbody>
</table>
@ -121,9 +121,12 @@
let list = ref([])
const currentInstance = getCurrentInstance()
let tableList = ref([])
let day = ref(1)
function toUrl() {
go.to('PAGES_PRODUCT_SALES_RANKING')
go.to('PAGES_PRODUCT_SALES_RANKING', {
day: day.value
})
}
function getlist(start, end) {
@ -175,26 +178,24 @@
//
function gettableData() {
let day = 1;
if (selected.value == 'today') {
day = 1
day.value = 1
} else if (selected.value == 'yesterday') {
day = 1
day.value = 1
} else if (selected.value == 'circumference') {
day = 7
day.value = 7
} else if (selected.value == 'moon') {
day = 30
day.value = 30
} else if (selected.value == 'custom') {
day = 30
day.value = 30
}
dateProduct({
shopId: uni.getStorageSync('shopId'),
day,
day: day.value,
page: 1,
size: 5
}).then((res) => {
// console.log(res, 'toapjso1')
tableList.value = res.totalProduct
tableList.value = res.productList.content
})
}
@ -255,7 +256,7 @@
.time-selected {
color: #318afe;
font-size: 32rpx!important;
font-size: 32rpx !important;
}
}

View File

@ -10,11 +10,11 @@
</tr>
</thead>
<tbody>
<tr v-for="item in tableList" :key="item.productId">
<td>{{item.productId}}</td>
<tr v-for="(item,index) in tableList" :key="item.productId">
<td>{{++index}}</td>
<td>{{item.productName}}</td>
<td>{{item.productNum}}</td>
<td>{{item.amount}}</td>
<td>{{item.num}}</td>
<td>{{item.salesAmount}}</td>
</tr>
</tbody>
</table>
@ -31,6 +31,11 @@
dateProduct
} from '@/http/yskApi/requestAll.js';
let tableList = ref([])
let props = defineProps({
day: {
type: Number
}
})
onMounted(() => {
gettableData()
})
@ -38,11 +43,11 @@
function gettableData() {
dateProduct({
shopId: uni.getStorageSync('shopId'),
day: 30,
page: 1,
day: props.day,
page: 0,
size: 50
}).then((res) => {
tableList.value = res.totalProduct
tableList.value = res.productList.content
})
}