Commit b3d3712e by zhouzy

1

1 parent a7eaa765
<template>
<!-- <div class="container">
<div class="box">
<div class="followForm">
<el-form :inline="true" class="demo-form-inline">
<el-form-item label="日期:">
<el-date-picker v-model="date" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" size="small" value-format="yyyy-MM-dd"></el-date-picker>
</el-form-item>
<el-form-item label="订单号:">
<el-input v-model="searchObj.orderId" placeholder="" size="small" class="formItem"></el-input>
</el-form-item>
<el-form-item label="用户信息:">
<el-input v-model="searchObj.phone" placeholder="" size="small" class="formItem"></el-input>
</el-form-item>
<el-form-item label="订单状态:">
<el-select v-model="searchObj.orderStatus" size="small" placeholder="请选择" class="formItem">
<el-option v-for="item in statusList" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button-group>
<el-button type="primary" size="small" @click="search">查询</el-button>
<el-button type="default" size="small" @click="reset">重置</el-button>
</el-button-group>
</el-form-item>
</el-form>
</div>
<div class="tableCtn">
<GLTable v-if="flag" ref="table" :searchForm="searchObj" :tableParams="tableParams" :getListApi="tableParams.getListApi" :hasNum="false"></GLTable>
</div>
</div>
</div> -->
<div class="container">
<div class="box">
<div class="layout">
<div class="tableBox">
<div class="search-box">
<div class="top">
<div class="item">
加油日期:
<el-date-picker v-model="date" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" size="small" value-format="yyyy-MM-dd" style="width: 220px"></el-date-picker>
</div>
<div class="item">
订单号:
<div class="input">
<el-input v-model="searchObj.orderId" placeholder="" size="small" class="formItem"></el-input>
</div>
</div>
<div class="item">
用户信息:
<div class="input">
<el-input v-model="searchObj.phone" placeholder="" size="small" class="formItem"></el-input>
</div>
</div>
<div class="item">
订单状态:
<el-select v-model="searchObj.orderStatus" size="small" placeholder="请选择" class="formItem">
<el-option v-for="item in statusList" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</div>
<div class="item" style="margin-left: auto">
<el-button type="primary" size="small" @click="search">查询</el-button>
<el-button type="default" size="small" @click="reset">重置</el-button>
</div>
</div>
</div>
<div class="tableCtn">
<GLTable v-if="flag" ref="table" :searchForm="searchObj" :tableParams="tableParams" :getListApi="tableParams.getListApi" :hasNum="false" :pageConf="pageConf"></GLTable>
</div>
</div>
</div>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
function date_format(date) {
var date2 = new Date(date)
var YY = date2.getFullYear() + '-'
var MM = (date2.getMonth() + 1 < 10 ? '0' + (date2.getMonth() + 1) : date2.getMonth() + 1) + '-'
var DD = date2.getDate() < 10 ? '0' + date2.getDate() : date2.getDate()
var hh = (date2.getHours() < 10 ? '0' + date2.getHours() : date2.getHours()) + ':'
var mm = (date2.getMinutes() < 10 ? '0' + date2.getMinutes() : date2.getMinutes()) + ':'
var ss = date2.getSeconds() < 10 ? '0' + date2.getSeconds() : date2.getSeconds()
return YY + MM + DD + ' ' + hh + mm + ss
}
import { searchMixin } from '@/mixins'
export default {
name: '',
mixins: [searchMixin],
data() {
return {
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
date_format,
flag: true,
statusList: [
{
label: '已结算',
value: '0'
},
{
label: '待结算',
value: '1'
},
{
label: '已失效',
value: '2'
}
],
tableParams: {
listName: 'list',
getListApi: this.$apis.orderApi.getEDJOrderList,
tableColumns: [
{
label: '日期',
minWidth: '200',
formatter: cell => {
return this.date_format(cell.callTime)
}
},
{
label: '用户信息',
prop: 'phone',
minWidth: '200'
},
{
label: '订单里程',
minWidth: '200',
formatter: cell => {
return `${cell.distance}km`
}
},
{
label: '实付金额',
prop: 'price',
minWidth: '200'
},
{
label: '订单总额',
prop: 'income',
minWidth: '200'
},
{
label: '订单号',
prop: 'orderId',
minWidth: '200'
},
{
label: '司机工号',
prop: 'driverId',
minWidth: '200'
},
{
label: '订单状态',
prop: 'status',
formatter: cell => {
return ['已结算', '待结算', '已失效'][cell.orderStatus]
},
minWidth: '200'
}
]
}
}
},
watch: {
date(n) {
let [callDateStart, callDateEnd] = n
this.searchObj.callDateStart = callDateStart || ''
this.searchObj.callDateEnd = callDateEnd || ''
}
},
mounted() {},
methods: {}
}
</script>
<style src="@a/css/tao.css">
</style>
<template>
<div class="container">
<div class="layout">
<div class="operationBox">
<div class="item lineCtn">
账户余额:{{ price }}元
<div style="margin-left: auto" class="operationBtn">
<el-button type="primary" @click="exportExcel">导出</el-button>
<el-button size="small" type="primary" @click="getHwAccount">刷新余额</el-button>
</div>
</div>
</div>
<div class="tableBox">
<div class="search-box">
<div class="top">
<div class="item">
日期:
<el-date-picker v-model="date" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" size="small" value-format="yyyy-MM-dd" style="width: 228px"></el-date-picker>
</div>
<div class="item">
品牌名称:
<div class="input">
<el-select v-model="searchObj.brandName" filterable size="small" placeholder="请选择" class="formItem">
<el-option v-for="item in brandList" :key="item.brandId" :label="item.brandName" :value="item.brandName"></el-option>
</el-select>
</div>
</div>
<div class="item">
商品名称:
<div class="input">
<el-input v-model="searchObj.productName" placeholder="" size="small" class="formItem"></el-input>
</div>
</div>
<div class="item">
商品形态:
<el-select size="small" v-model="searchObj.appereance" placeholder="请选择" class="formItem">
<el-option v-for="item in appereanceList" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</div>
<div class="item">
门店名称:
<div class="input">
<el-input v-model="searchObj.merchantName" placeholder="" size="small" class="formItem"></el-input>
</div>
</div>
<div class="item">
订单状态:
<el-select size="small" v-model="searchObj.orderStatus" placeholder="请选择" class="formItem">
<el-option v-for="item in statusList" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</div>
<div class="item" style="margin-left: auto">
<el-button type="primary" size="small" @click="search">查询</el-button>
<el-button type="default" size="small" @click="reset">重置</el-button>
</div>
</div>
</div>
<div class="tableCtn">
<GLTable v-if="flag" ref="table" :searchForm="searchObj" :tableParams="tableParams" :getListApi="tableParams.getListApi" :hasNum="false" :pageConf="pageConf">
<template slot="custom">
<div class="table-custom exportBtn"></div>
</template>
</GLTable>
</div>
</div>
</div>
</div>
</template>
<script type='text/ecmascript-6'>
import { orderMixin, searchMixin } from '@/mixins'
export default {
name: '',
mixins: [orderMixin, searchMixin],
data() {
return {
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
flag: true,
price: 0,
tableParams: {
listName: 'list',
showSummary: true,
getListApi: this.$apis.orderApi.getBalanceList,
summaryMethod({ columns, data }) {
let sums = []
columns.forEach((column, index) => {
if (index == 0) {
sums[index] = '合计'
return
}
const values = data.map(item => {
if (column.property == 'costPrices' || column.property == 'orderPrices' || column.property == 'discount') {
return Number(item[column.property])
}
return NaN
})
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr)
if (!isNaN(value)) {
return prev + curr
} else {
return prev
}
}, 0)
sums[index] = `${this.decimal(sums[index], 2).toFixed(2)}元`
} else {
sums[index] = ''
}
})
return sums
},
tableColumns: [
{
label: '订单编号',
prop: 'orderCode',
minWidth: '200'
},
{
label: '品牌名称',
prop: 'brandName',
minWidth: '200'
},
{
label: '商品形态',
prop: 'appearanceDesc',
minWidth: '100'
},
{
label: '商品名称',
minWidth: '200',
formatter(cell) {
return cell.appearance == 2 ? `${cell.productName}${cell.denomination}` : cell.productName
}
},
{
label: '订单成本金额',
prop: 'costPrices',
minWidth: '200'
},
{
label: '订单支付金额',
prop: 'orderPrices',
minWidth: '200'
},
{
label: '销售差额',
prop: 'discount',
minWidth: '200'
},
{
label: '下单渠道',
minWidth: '200',
formatter(cell) {
return `${cell.merchantName || ''}${cell.merchantName ? '-' : ''}${cell.channelName}`
}
},
{
label: '订单状态',
minWidth: '200',
formatter: cell => {
return cell.appearance == 1 ? this.statusEnum[cell.orderStatus] : this.qb_statusEnum[cell.orderStatus]
}
},
{
label: '下单时间',
prop: 'orderDate',
minWidth: '200',
formatter(cell) {
return cell.orderDate ? new Date(cell.orderDate).format('yyyy-MM-dd hh:mm:ss') : '- -'
}
}
]
}
}
},
mounted() {
this.getHwAccount()
},
methods: {
getHwAccount() {
this.$apis.orderApi.getHwAccount().then(({ code, data }) => {
if (code == 0) {
this.price = data
}
})
},
exportExcel() {
this.$apis.orderApi.exportBalanceList(this.searchObj).then(({ code, data, message }) => {
if (code == 0) {
let a = document.createElement('a')
a.setAttribute('href', data)
a.setAttribute('target', '_blank')
a.setAttribute('download', '权益订单统计数据.xlsx')
a.click()
} else {
this.$message.error(message)
}
})
}
}
}
</script>
<style src="@a/css/tao.css"></style>
<style>
.exportBtn {
float: right;
margin-top: 10px;
}
.lineCtn {
display: flex;
flex-direction: row;
}
</style>
<style src="@a/css/tao.css"></style>
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<img :src="editForm.qrCode" ref="Qrcode" id="qrCode" /> <img :src="editForm.qrCode" ref="Qrcode" id="qrCode" />
<div class="tryDays">{{ tryNum }}天试用</div> <div class="tryDays">{{ tryNum }}天试用</div>
</div> </div>
<el-form-item label="领取链接" prop="" style="margin-top:20px"> <el-form-item label="领取链接" prop="" style="margin-top: 20px">
<div class="lineCtn"> <div class="lineCtn">
<el-input disabled="true" :value="`${editForm.url}`" maxlength="14" placeholder="请输入链接" clearable></el-input> <el-input disabled="true" :value="`${editForm.url}`" maxlength="14" placeholder="请输入链接" clearable></el-input>
<el-button size="small" type="primary" @click="closeText(`${editForm.url}`)">复制链接</el-button> <el-button size="small" type="primary" @click="closeText(`${editForm.url}`)">复制链接</el-button>
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
<el-form-item label="试用时长:" :prop="value == false ? '' : 'tryNum'"> <el-form-item label="试用时长:" :prop="value == false ? '' : 'tryNum'">
<el-input-number v-model="tryNum" controls-position="right" size="mini" :disabled="!hasTryNum" :min="1" :max="100"></el-input-number> <el-input-number v-model="tryNum" controls-position="right" size="mini" :disabled="!hasTryNum" :min="1" :max="100"></el-input-number>
天试用 天试用
<span class="codeTxt">设置后将生成试用链接和二维码可用于推广</span> <span class="codeTxt2">设置后将生成试用链接和二维码可用于推广</span>
</el-form-item> </el-form-item>
</div> </div>
</div> </div>
...@@ -683,6 +683,11 @@ export default { ...@@ -683,6 +683,11 @@ export default {
font-size: 12px; font-size: 12px;
margin-left: -97px; margin-left: -97px;
} }
.code {
color: #8c939d;
font-size: 12px;
margin-left: 8px;
}
.main-qrcode { .main-qrcode {
text-align: center; text-align: center;
margin-bottom: 10px; margin-bottom: 10px;
...@@ -735,8 +740,8 @@ export default { ...@@ -735,8 +740,8 @@ export default {
font-size: 14px; font-size: 14px;
word-break: break-all; word-break: break-all;
} }
.tryDays{ .tryDays {
margin-top: 12px; margin-top: 12px;
} }
</style> </style>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!