yyw提交

This commit is contained in:
DESKTOP-8FGKA8Q\chunfen 2024-08-19 16:39:53 +08:00
parent 5214fa853c
commit 2ac84ea838
5 changed files with 44 additions and 9 deletions

View File

@ -2,7 +2,7 @@
<div>
<div class="cardBox">
<div class="searchBox">
<div class="row">
<div class="row" style="width: 100%;">
<span>统计时间</span>
<el-select v-model="time_type" style="width: 100px;margin-right: 5px;" @change="changeTimeType">
<el-option v-for="item in timeTypeList" :key="item.value" :label="item.label" :value="item.value">
@ -65,6 +65,16 @@
<span v-else>{{ startTime }}~{{ endTime }}</span>
</div>
</div>
<div class="row">
<span>规格</span>
<el-select v-model="sku_id" filterable remote clearable reserve-keyword placeholder="请选择具体规格" :remote-method="remoteMethod"
:loading="remoteLoading">
<el-option v-for="it in skusList" :key="it.id" :label="it.title" :value="it.id"></el-option>
</el-select>
</div>
<div class="row">
<el-button type="primary" @click="handleSearch()" icon="el-icon-search">筛选</el-button>
</div>
</div>
</div>
@ -76,6 +86,7 @@
<script>
import { getGmvCount } from "@/api/dataCenter.js"
import { getGoodsFilter } from "@/api/goods.js"
import dayjs from 'dayjs'
import * as echarts from 'echarts'
@ -102,7 +113,9 @@ export default {
SaleCount: [],
myChart: null,
dayTimeList: [],
sku_id: ''
sku_id: '',
skusList: [],
remoteLoading: false
}
},
mounted() {
@ -152,13 +165,15 @@ export default {
type: 1,
interval: 60,
start_time: this.startTime,
end_time: this.endTime
end_time: this.endTime,
sku_id: this.sku_id || 0
}
} else {
params = {
type: 2,
start_day: this.startTime,
end_day: this.endTime
end_day: this.endTime,
sku_id: this.sku_id || 0
}
}
getGmvCount(params).then((res) => {
@ -282,6 +297,20 @@ export default {
this.startTime = time + ' ' + this.dayTimeList[0]
this.endTime = time + ' ' + this.dayTimeList[1]
this.fetchData()
},
handleSearch() {
this.fetchData()
},
remoteMethod(query) {
if(query) {
this.remoteLoading = true
getGoodsFilter(query).then((res) => {
this.skusList = res.data.data
this.remoteLoading = false
})
} else {
this.skusList = []
}
}
},
beforeDestroy() {

View File

@ -67,7 +67,7 @@
</div>
<div class="row">
<span>规格</span>
<el-select v-model="sku_id" filterable remote reserve-keyword placeholder="请选择具体规格" :remote-method="remoteMethod"
<el-select v-model="sku_id" filterable remote clearable reserve-keyword placeholder="请选择具体规格" :remote-method="remoteMethod"
:loading="remoteLoading">
<el-option v-for="it in skusList" :key="it.id" :label="it.title" :value="it.id"></el-option>
</el-select>

View File

@ -67,7 +67,7 @@
</div>
<div class="row">
<span>规格</span>
<el-select v-model="sku_id" filterable remote reserve-keyword placeholder="请选择具体规格" :remote-method="remoteMethod"
<el-select v-model="sku_id" filterable remote clearable reserve-keyword placeholder="请选择具体规格" :remote-method="remoteMethod"
:loading="remoteLoading">
<el-option v-for="it in skusList" :key="it.id" :label="it.title" :value="it.id"></el-option>
</el-select>

View File

@ -67,7 +67,7 @@
</div>
<div class="row">
<span>规格</span>
<el-select v-model="sku_id" filterable remote reserve-keyword placeholder="请选择具体规格" :remote-method="remoteMethod"
<el-select v-model="sku_id" filterable remote clearable reserve-keyword placeholder="请选择具体规格" :remote-method="remoteMethod"
:loading="remoteLoading">
<el-option v-for="it in skusList" :key="it.id" :label="it.title" :value="it.id"></el-option>
</el-select>

View File

@ -241,9 +241,15 @@
</template>
</el-table-column>
<el-table-column label="销存比例" align="center">
<el-table-column align="center">
<template slot="header" slot-scope="scope">
<span>销存比例</span>
<el-tooltip class="item" effect="dark" content="当前库存/当天7点盘点的库存" placement="top">
<i class="el-icon-question"></i>
</el-tooltip>
</template>
<template slot-scope="scope">
<span :class="scope.row.sale_ratio * 1 < 20 ? 'red' : ''">{{ scope.row.sale_ratio }}</span>
<span :class="scope.row.sale_ratio * 1 < 20 ? 'red' : ''">{{ scope.row.sale_ratio }}%</span>
</template>
</el-table-column>