Commit f56f6b38 by 吴娟华

'修复总览订单bug'

1 parent ea1b04c6
......@@ -292,7 +292,7 @@ export const resources = {
}, {
authId: '9040102',
parentId: '90401',
label: '查看订单',
label: '查看详情',
handle: 'handleDetail'
}],
component: _import('orderManage/orderList')
......
......@@ -98,7 +98,7 @@
</tr>
<tr>
<td class="lb">成本费用</td>
<td>{{detail.shopCost}}</td>
<td>{{detail.yqCost}}</td>
<td class="lb">参与分账金额</td>
<td colspan="3">{{detail.allocationMoney}}</td>
</tr>
......
......@@ -34,7 +34,7 @@
</div>
<div class="summary_total">
<span class="summary_total_label">总订单收入</span>
<span class="summary_total_value">{{summayData.totalInComeMoney}}</span>
<span class="summary_total_value">{{summayData.totalIncomeMoney}}</span>
</div>
<div class="summary_list">
<div class="summary_item">
......
......@@ -13,15 +13,29 @@ const incomeProductOption = {
},
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b} : {c} ({d}%)'
formatter: (params) => {
return `${insertBr(params.name)} : ${params.value}(${params.percent}%)`
},
position: [10, 10]
},
series: [
{
name: '毛利',
type: 'pie',
radius: ['50%', '70%'],
radius: ['40%', '60%'],
center: ['50%', '60%'],
label:{
align: 'left',
normal:{
formatter(v) {
let text = v.name
return insertBr(text)
},
textStyle : {
fontSize : 10
}
}
},
data: [
{ value: 335, name: '直接访问' },
{ value: 310, name: '邮件营销' },
......@@ -39,5 +53,17 @@ const incomeProductOption = {
}
]
}
function insertBr(text) {
if(text.length <= 8){
return text;
}else if(text.length > 8 && text.length <= 16){
return text = `${text.slice(0,8)}\n${text.slice(8)}\n`
}else if(text.length > 16 && text.length <= 24){
return text = `${text.slice(0,8)}\n${text.slice(8,16)}\n${text.slice(16)}\n`
}else if(text.length > 24 && text.length <= 30){
return text = `${text.slice(0,8)}\n${text.slice(8,16)}\n${text.slice(16,24)}\n${text.slice(24)}\n`
}else if(text.length > 30){
return text = `${text.slice(0,8)}\n${text.slice(8,16)}\n${text.slice(16,24)}\n${text.slice(24,30)}\n${text.slice(30)}\n`
}
}
export default incomeProductOption
......@@ -17,7 +17,7 @@
</div>
<div style="text-align: right;">
<el-radio-group v-model="totalType" type="info" size="mini">
<el-radio-button label="yesterday">昨日</el-radio-button>
<el-radio-button label="today">今日</el-radio-button>
<el-radio-button label="thisWeek">本周</el-radio-button>
<el-radio-button label="thisMonth">本月</el-radio-button>
</el-radio-group>
......@@ -97,7 +97,7 @@
</div>
<div>
<el-radio-group v-model="customerType" type="info" size="mini">
<el-radio-button label="yesterday">昨日</el-radio-button>
<el-radio-button label="today">今日</el-radio-button>
<el-radio-button label="thisWeek">本周</el-radio-button>
<el-radio-button label="thisMonth">本月</el-radio-button>
</el-radio-group>
......@@ -113,7 +113,7 @@
<div class="top_card_md">
<span class="top_card_md_right top_card_primary">{{customerData.totalCustomerNums}}</span>
</div>
<div class="top_card_bm" v-show="customerType==='yesterday'">
<div class="top_card_bm" v-show="customerType==='today'">
<span class="top_card_bm_left">周同比:{{customerData.onWeekCustomerNums}}%</span>
<span class="top_card_bm_right customer">日环比:{{customerData.onDayCustomerNums}}%</span>
</div>
......@@ -131,7 +131,7 @@
<div class="top_card_md">
<span class="top_card_md_right top_card_second">{{customerData.totalToShop}}</span>
</div>
<div class="top_card_bm" v-show="customerType==='yesterday'">
<div class="top_card_bm" v-show="customerType==='today'">
<span class="top_card_bm_left">周同比:{{customerData.onWeekToShop}}%</span>
<span class="top_card_bm_right customer">日环比:{{customerData.onDayToShop}}%</span>
</div>
......@@ -149,13 +149,13 @@
<div class="top_card_md">
<span class="top_card_md_right top_card_third">{{customerData.upgradeTransfer}}%</span>
</div>
<div class="top_card_bm" v-show="customerType==='yesterday'">
<div class="top_card_bm" v-show="customerType==='today'">
<span class="top_card_bm_left">周同比:{{customerData.onWeekUpgradeTransfer}}%</span>
<span class="top_card_bm_right customer">日环比:{{customerData.onDayUpgradeTransfer}}%</span>
</div>
<div class="top_card_bm">
<span class="top_card_bm_left">日均转化率(比)</span>
<span class="top_card_bm_right">{{customerData.perDayUpgradeTransfer}}</span>
<span class="top_card_bm_right">{{customerData.perDayUpgradeTransfer}}%</span>
</div>
</div>
</div>
......@@ -279,7 +279,7 @@ export default {
userInfo: this.$store.state.d2admin.user.info,
customTransChart: null,
todayInviteCount: '',
totalType: 'yesterday',
totalType: 'today',
totalData: {
totalCustomerNums: '',
customerTransfer: '',
......@@ -288,7 +288,7 @@ export default {
totalFlowsMoney: '',
totalGrossProfit: ''
},
customerType: 'yesterday',
customerType: 'today',
customerData: {
totalCustomerNums: '',
onDayCustomerNums: '',
......@@ -481,23 +481,25 @@ export default {
this.showChartLoading(this.orderProductChart)
const params = {
yqMerchantId: this.id,
/* beginDateStr: '2020-12-07',
endDateStr: '2020-12-13', */
...(this.getDateFormatByType('thisWeek'))
beginDateStr: '2020-12-07',
endDateStr: '2020-12-13',
//...(this.getDateFormatByType('thisWeek'))
}
getOrderProductData(params).then((res) => {
const data = res
const colors = ['rgba(9,71,198,0.8)', 'rgba(9,71,198,0.4)','rgba(9,71,198,1)']
let idObj = {}
for(let key in data) {
let index = moment(key).day() - 1
let index = moment(key).format('E')-1
console.log(index)
let list = data[key]
list.forEach((item) => {
list.forEach((item, i) => {
if (!(item.id in idObj)) {
idObj[item.id] = {
data: [],
name: item.goodsName
name: item.goodsName,
color: colors[i]
}
}
idObj[item.id].data.push([index, item.goodsTotal])
......@@ -510,14 +512,19 @@ export default {
name: idObj[key].name,
type: 'bar',
stack: '总量',
//barGap: '-100%',
label: {
show: false,
formatter: '{a}',
position: 'insideRight'
},
itemStyle: {
color: idObj[key].color
},
data: idObj[key].data
})
}
orderProductOption.series = seriesArr
this.orderProductChart.setOption(orderProductOption)
this.hideChartLoading(this.orderProductChart)
......@@ -581,6 +588,10 @@ export default {
let endDateStr = ''
switch (type) {
case 'today':
beginDateStr = moment().startOf('day').format('YYYY-MM-DD')
endDateStr = moment().endOf('day').format('YYYY-MM-DD')
break
case 'yesterday':
beginDateStr = moment().subtract(1, 'day').startOf('day').format('YYYY-MM-DD')
endDateStr = moment().subtract(1, 'day').endOf('day').format('YYYY-MM-DD')
......@@ -621,8 +632,8 @@ export default {
...this.getDateFormatByType(this.customerType),
yqMerchantId: this.id
}
if (this.customerType === 'yesterday') {
params.needCompareDateStr = moment().subtract(1, 'day').startOf('day').format('YYYY-MM-DD')
if (this.customerType === 'today') {
params.needCompareDateStr = moment().startOf('day').format('YYYY-MM-DD')
}
getCustomerData(params).then((res) => {
console.log(res)
......
const orderProductOption = {
color: ['rgba(9,71,198,0.8)', 'rgba(0,157,255,1)','rgba(255,178,25,1)'],
color: ['rgba(9,71,198,1)', 'rgba(9,71,198,0.8)','rgba(9,71,198,0.6)',],
tooltip: {
trigger: 'axis',
axisPointer: {
......
const storeFlowOption = {
color: ['rgba(9,71,198,1)', 'rgba(9,71,198,0.8)', 'rgba(9,71,198,0.6)','rgba(9,71,198,0.4)','rgba(9,71,198,0.3)'],
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b} : {c} ({d}%)',
//formatter: '{a} <br/>{b} : {c} ({d}%)',
formatter: (params) => {
console.log(params)
return `${insertBr(params.name)} : ${params.value}(${params.percent}%)`
},
position: [10, 10]
},
legend: {
......@@ -17,30 +22,23 @@ const storeFlowOption = {
},
tooltip: {
show: true
},
textStyle: {
fontSize: '11'
}
},
series: [
{
name: '4s门店客流量',
type: 'pie',
radius: '55%',
radius: '50%',
center: ['40%', '65%'],
label:{
align: 'left',
normal:{
formatter(v) {
let text = v.name
if(text.length <= 8){
return text;
}else if(text.length > 8 && text.length <= 16){
return text = `${text.slice(0,8)}\n${text.slice(8)}\n`
}else if(text.length > 16 && text.length <= 24){
return text = `${text.slice(0,8)}\n${text.slice(8,16)}\n${text.slice(16)}\n`
}else if(text.length > 24 && text.length <= 30){
return text = `${text.slice(0,8)}\n${text.slice(8,16)}\n${text.slice(16,24)}\n${text.slice(24)}\n`
}else if(text.length > 30){
return text = `${text.slice(0,8)}\n${text.slice(8,16)}\n${text.slice(16,24)}\n${text.slice(24,30)}\n${text.slice(30)}\n`
}
return insertBr(text)
},
textStyle : {
fontSize : 10
......@@ -77,4 +75,18 @@ const storeFlowOption = {
]
}
function insertBr(text) {
if(text.length <= 8){
return text;
}else if(text.length > 8 && text.length <= 16){
return text = `${text.slice(0,8)}\n${text.slice(8)}\n`
}else if(text.length > 16 && text.length <= 24){
return text = `${text.slice(0,8)}\n${text.slice(8,16)}\n${text.slice(16)}\n`
}else if(text.length > 24 && text.length <= 30){
return text = `${text.slice(0,8)}\n${text.slice(8,16)}\n${text.slice(16,24)}\n${text.slice(24)}\n`
}else if(text.length > 30){
return text = `${text.slice(0,8)}\n${text.slice(8,16)}\n${text.slice(16,24)}\n${text.slice(24,30)}\n${text.slice(30)}\n`
}
}
export default storeFlowOption
......@@ -95,7 +95,7 @@
header-cell-style="text-align:center; background-color:#fafafa"
style="width: 100%">
<el-table-column
prop="createdDate"
prop="createdDateStr"
align="center"
label="时间">
</el-table-column>
......@@ -114,11 +114,16 @@
</el-table-column>
</el-table>
</div>
</div>
<p style="text-align:center;">
<el-button type="primary" @click="close({ tagName: '/orderDetail' })">关闭</el-button>
</p>
</d2-container>
</template>
<script>
import { mapActions } from 'vuex'
import { getOrderDetail } from '@api/order'
export default {
name: 'orderDetail',
......@@ -163,6 +168,7 @@ export default {
},
methods: {
...mapActions({ close: 'd2admin/page/close' }),
arraySpanMethod({ row, column, rowIndex, columnIndex }) {
if(rowIndex === 1) {
if(columnIndex === 0) {
......
......@@ -205,11 +205,15 @@ export default {
if(this.form.merchantProfitValue == '-1') {
this.form.merchantProfitType = 2
this.form.merchantProfitValue = ''
} else {
this.form.merchantProfitType = 1
}
if(this.form.partnerProfitPer == '-1') {
this.form.partnerProfitType = 2
this.form.partnerProfitPer = ''
} else {
this.form.partnerProfitType = 1
}
}
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!