Compare commits

3 Commits

Author SHA1 Message Date
xk_chenlianjie
8caf900372 Merge branch 'master' of http://121.196.213.68:3000/caoliancun/PointsMall_Admin into chenlianjie 2024-01-24 08:41:09 +08:00
xk_chenlianjie
44ca930c3a 统计 2024-01-24 08:40:55 +08:00
dt_2916866708
3f76c2bf9a 123 2024-01-22 10:37:46 +08:00
3 changed files with 67 additions and 70 deletions

View File

@@ -527,8 +527,7 @@ export default {
console.log(res, "productAddGetSites") console.log(res, "productAddGetSites")
}) })
}, },
inverseAnalysis(data) { async inverseAnalysis(data) {
console.log(data,"data")
let { categoryOneId, categoryTwoId } = data; let { categoryOneId, categoryTwoId } = data;
let categorys = [categoryOneId, categoryTwoId]; let categorys = [categoryOneId, categoryTwoId];
this.OilStationSelectionList = data.siteInfos; this.OilStationSelectionList = data.siteInfos;
@@ -538,13 +537,10 @@ export default {
}); });
this.$refs.CustomUpload.fileList = [...this.formValidate.images.filter(item=>item.mainMark=="1")]; this.$refs.CustomUpload.fileList = [...this.formValidate.images.filter(item=>item.mainMark=="1")];
this.$refs.CustomLBUpload.fileList = [...this.formValidate.images.filter(item=>item.mainMark!="1")] ; this.$refs.CustomLBUpload.fileList = [...this.formValidate.images.filter(item=>item.mainMark!="1")] ;
this.confirm(); await this.confirm();
this.$nextTick(()=>{ this.$nextTick(()=>{
setTimeout(() => {
console.log(this.formValidate,"this.formValidate.arr")
}, 1000);
this.formValidate.attr = this.formValidate.attr.map(item=>{ this.formValidate.attr = this.formValidate.attr.map(item=>{
let align = this.formValidate.checkedList.find(i=>item.id==i.attributeId); let align = this.formValidate.checkedList.find(i=>item.id==i.attributeId);
if(align){ if(align){
return { return {
...item, ...item,
@@ -556,13 +552,12 @@ export default {
}else{ }else{
return null return null
} }
}).filter(item=>item); }).filter(item=>item);
setTimeout(() => { setTimeout(() => {
this.ManyAttrValue.forEach((item,index)=>{ this.ManyAttrValue.forEach((item,index)=>{
let data = this.formValidate.stockList.find(i=>i.attributeJson==JSON.stringify(item.data)) let data = this.formValidate.stockList.find(i=>i.attributeJson==JSON.stringify(item.data))
if(data){ if(data){
Object.assign(item,data); Object.assign(item,data);
console.log(data,item,"datadatadatadata")
} }
}) })
}, 1000); }, 1000);
@@ -776,13 +771,15 @@ export default {
if (num) this.productGetRule() if (num) this.productGetRule()
}, },
// 选择属性确认 // 选择属性确认
async confirm() { async confirm(is=true) {
this.isAttr = true this.isAttr = true
if (!this.formValidate.attributesTypeId) { if(is){
if (!this.formValidate.attributesTypeId) {
return this.$message.warning('请选择属性') return this.$message.warning('请选择属性')
} }
await this.productGetRule(); await this.productGetRule();
this.formValidate.attr = JSON.parse(JSON.stringify(this.ruleList.find(item => item.id == this.formValidate.attributesTypeId).attributesList)); this.formValidate.attr = JSON.parse(JSON.stringify(this.ruleList.find(item => item.id == this.formValidate.attributesTypeId).attributesList));
}
}, },
// 商品分类; // 商品分类;
getCategorySelect() { getCategorySelect() {

View File

@@ -21,6 +21,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<div style="width: 100%; height:500px;margin-top:20px" id="chart"></div>
<el-table <el-table
:data="productList" :data="productList"
@@ -146,6 +147,7 @@
<script> <script>
import marketingApi from '@/api/finance/marketing.js' import marketingApi from '@/api/finance/marketing.js'
import echarts from 'echarts'
export default { export default {
name: 'product_productList', name: 'product_productList',
@@ -212,10 +214,42 @@ export default {
goodsId: '', goodsId: '',
isProductBox: false, isProductBox: false,
multipleSelection: [], multipleSelection: [],
detailData: {} //详情对象 detailData: {}, //详情对象
myChart: '',
option: {
title: {
text: '一级分类商品',
// subtext: 'Fake Data',
left: 'center'
},
tooltip: {
trigger: 'item'
},
legend: {
// orient: 'vertical',
bottom: '20'
},
series: [
{
type: 'pie',
radius: '50%',
center: ['30%', '50%'],
data: []
},
{
type: 'pie',
radius: '50%',
center: ['75%', '50%'],
data: []
}
]
}
} }
}, },
created() { created() {},
mounted() {
this.myChart = echarts.init(document.getElementById('chart'))
var DaysAgo = this.timeBefore() var DaysAgo = this.timeBefore()
var sevenDaysAgo = this.timeBefore7() var sevenDaysAgo = this.timeBefore7()
console.log('sevenDaysAgo', sevenDaysAgo, DaysAgo) console.log('sevenDaysAgo', sevenDaysAgo, DaysAgo)
@@ -231,8 +265,8 @@ export default {
this.getChartList() this.getChartList()
}, },
activated() {},
methods: { methods: {
closeLabel(label) { closeLabel(label) {
let index = this.dataLabel.indexOf(this.dataLabel.filter(d => d.id == label.id)[0]) let index = this.dataLabel.indexOf(this.dataLabel.filter(d => d.id == label.id)[0])
this.dataLabel.splice(index, 1) this.dataLabel.splice(index, 1)
@@ -328,8 +362,26 @@ export default {
await marketingApi.commodityChart(this.createTime).then(res => { await marketingApi.commodityChart(this.createTime).then(res => {
if ((res.code = 20000)) { if ((res.code = 20000)) {
this.productList = res.data this.productList = res.data
for (var i = 0; i < this.productList.length; i++) {
var obj = new Object()
var obj2 = new Object()
obj.name = this.productList[i].categoryName
obj.value = this.productList[i].sellNum
obj2.name = this.productList[i].categoryName
obj2.value = this.productList[i].sellMoney
this.option.series[0].data[i] = obj
this.option.series[1].data[i] = obj2
}
console.log('op', this.option)
console.log('series', this.option.series)
this.myChart.setOption(this.option)
} }
}) })
window.onresize = function() {
this.myChart.resize()
}
}, },
// 商品销售列表 // 商品销售列表
async getList() { async getList() {

View File

@@ -1,6 +1,5 @@
<template> <template>
<div class="article-manager"> <div class="article-manager">
<div style="width: 100%; height:500px" id="chart"></div>
<el-card :bordered="false" shadow="never" class="ivu-mt mt16" :body-style="{ padding: '0 20px 20px' }"> <el-card :bordered="false" shadow="never" class="ivu-mt mt16" :body-style="{ padding: '0 20px 20px' }">
<!-- <div > <!-- <div >
<el-form :model="page" label-width="80px" label-position="right" inline @submit.native.prevent class="mt16"> <el-form :model="page" label-width="80px" label-position="right" inline @submit.native.prevent class="mt16">
@@ -79,7 +78,6 @@
<script> <script>
import marketingApi from '@/api/finance/marketing.js' import marketingApi from '@/api/finance/marketing.js'
import echarts from "echarts";
export default { export default {
name: 'product_productList', name: 'product_productList',
@@ -117,60 +115,10 @@ export default {
this.getList() this.getList()
}, },
mounted() {
this.echartsInit()
},
activated() { }, activated() { },
methods: { methods: {
echartsInit() {
var myChart = echarts.init(document.getElementById('chart'));
let option = {
title: {
text: '一级分类商品',
// subtext: 'Fake Data',
left: 'center'
},
tooltip: {
trigger: 'item'
},
legend: {
// orient: 'vertical',
bottom: "20"
},
series: [
{
type: 'pie',
radius: '50%',
center: ['25%', '50%'],
data: [
{ value: 335, name: '彩妆' },
{ value: 310, name: '留学' },
{ value: 310, name: '派遣玉缘轩' },
{ value: 310, name: '法律服务' },
{ value: 310, name: '食品' }
]
},
{
type: 'pie',
radius: '50%',
center: ['75%', '50%'],
data: [
{ value: 310, name: '餐饮' },
{ value: 310, name: '酒水汽车' },
{ value: 310, name: '厨具家电男装' },
{ value: 310, name: '口腔护理洗护' },
{ value: 310, name: '学习' }
]
}
]
};
myChart.setOption(option);
//动态修改图大小
window.onresize = function () {
myChart.resize();
};
},
closeLabel(label) { closeLabel(label) {
let index = this.dataLabel.indexOf(this.dataLabel.filter(d => d.id == label.id)[0]) let index = this.dataLabel.indexOf(this.dataLabel.filter(d => d.id == label.id)[0])
this.dataLabel.splice(index, 1) this.dataLabel.splice(index, 1)