销售汇总修改接口

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) { export function dateProduct(params) {
return request({ return request({
url: '/api/summary/dateProduct', url: '/api/summary/productSaleDate',
method: 'get', method: 'get',
params params
}) })

View File

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

View File

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