Commit 1bce1eea by xinla

Merge branch 'develop' of https://e.coding.net/linkwechat/linkwechat-front/linkwechat into develop

2 parents e70774e9 0e93337c
...@@ -71,7 +71,7 @@ export function add(data) { ...@@ -71,7 +71,7 @@ export function add(data) {
* 修改 * 修改
* @param {*} data 同新增 * @param {*} data 同新增
*/ */
export function update(id, data) { export function update(data, id) {
return request({ return request({
url: service + '/update/' + id, url: service + '/update/' + id,
method: 'put', method: 'put',
...@@ -85,7 +85,30 @@ export function update(id, data) { ...@@ -85,7 +85,30 @@ export function update(id, data) {
*/ */
export function remove(ids) { export function remove(ids) {
return request({ return request({
url: service + '/' + ids, url: service + '/delete/' + ids,
method: 'DELETE', method: 'DELETE',
}) })
} }
// 商品详情统计
export function getDetailTotal(id) {
return request({
url: service + '/statistics/' + id,
})
}
// 商品详情折线图
export function getDetailChart(data) {
return request({
url: service + '/lineChart',
data,
method:'post'
})
}
// 商品详情top5
export function getDetailTable(id) {
return request({
url: service + '/top5/' + id
})
}
\ No newline at end of file \ No newline at end of file
<template>
<div class="search">
<div class="item">
<el-button-group>
<el-button size="mini" @click="setType(1)" :type="active === 1 ? 'primary' : ''">近一周</el-button>
<el-button size="mini" @click="setType(2)" :type="active === 2 ? 'primary' : ''">近一月</el-button>
<el-button size="mini" @click="setType(3)" :type="active === 3 ? 'primary' : ''">自定义</el-button>
</el-button-group>
</div>
<div class="item" v-if="active === 3">
<el-date-picker
style="width: 250px;"
@change="setTime"
size="mini"
clearable
v-model="value"
type="daterange"
:picker-options="pickerOptions"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
>
</el-date-picker>
</div>
</div>
</template>
<script>
import moment from 'moment'
export default {
name: 'search-title',
props: {},
data() {
return {
active: 1,
value: [],
options: [{ value: 10, label: '1123' }],
value2: [],
data: {
beginTime: '',
endTime: ''
},
sceneList: [],
customerList: [],
manList: []
}
},
methods: {
submit() {
this.$emit('search', this.data)
},
setTime(e) {
if (e) {
this.data.beginTime = moment(e[0]).format('YYYY-MM-DD')
this.data.endTime = moment(e[1]).format('YYYY-MM-DD')
} else {
this.data.beginTime = ''
this.data.endTime = ''
}
this.submit()
},
setType(type) {
this.active = type
if (type === 1) {
const weekStart = moment().subtract(6, 'days').format('YYYY-MM-DD')
const weekEnd = moment().format('YYYY-MM-DD')
this.data.beginTime = weekStart
this.data.endTime = weekEnd
this.submit()
} else if (type === 2) {
this.data.endTime = moment().format('YYYY-MM-DD')
this.data.beginTime = moment().subtract(29, 'days').format('YYYY-MM-DD')
this.submit()
}
}
},
created() {
this.setType(1)
}
}
</script>
<style lang="scss" scoped>
.search {
display: flex;
align-items: center;
.item {
margin-right: 20px;
}
}
</style>
...@@ -51,36 +51,6 @@ const devRoutes = [ ...@@ -51,36 +51,6 @@ const devRoutes = [
}, },
], ],
}, },
{
path: '/commodityCenter',
component: Layout,
hidden: true,
meta: {
title: '商品中心',
},
children: [
{
path: 'commodityManage',
name: 'group-code-analyse',
component: (resolve) => require(['@/views/commodityCenter/commodityManage/list'], resolve),
meta: {
title: '商品管理',
activeMenu: '/commodityCenter/commodityManage',
breadcrumb: true,
},
},
{
path: 'detail',
name: 'group-code-analyse',
component: (resolve) => require(['@/views/commodityCenter/commodityManage/detail'], resolve),
meta: {
title: '商品管理',
activeMenu: '/commodityCenter/commodityManage',
breadcrumb: true,
},
},
],
},
] ]
// 公共路由 // 公共路由
......
<script> <script>
import RemoteDataView from '@/components/RemoteDataView' import CardGroupIndex from '@/components/CardGroupIndex'
import CardGroupIndex from '@/components/CardGroupIndex' import TimeSearchTitle from '@/components/common/TimeSearchTitle'
import * as api from '@/api/commodityCenter/commodityManage' import ChartLine from '@/components/ChartLine.vue'
export default { import * as api from '@/api/commodityCenter/commodityManage'
export default {
name: '', name: '',
components: { RemoteDataView, CardGroupIndex }, components: { TimeSearchTitle, CardGroupIndex, ChartLine },
data() { data() {
return { return {
loading: false,
list: [],
legend: ['订单总额', '退款总额', '净收入'],
xData: [],
series: [],
cardData: [], cardData: [],
active: 0, active: 0,
api, api,
form: {
picture: '',
price: 1,
describe: '',
attachments: []
}
} }
}, },
computed: {}, computed: {},
watch: {}, watch: {},
created() { created() {
this.getDetail()
this.getList() this.getList()
this.getTop5Fn()
}, },
mounted() {}, mounted() {},
methods: { methods: {
getDetail() {
api.getDetail(this.$route.query.id).then((res) => {
this.form = res.data
this.form.attachments = this.form.attachments.split(',')
})
},
getTop5Fn() {
this.loading = true
api.getDetailTable(this.$route.query.id).then((res) => {
if (res.code === 200) {
this.list = res.data
}
this.loading = false
})
},
getList() { getList() {
this.loading = true this.loading = true
api api
.getDetail() .getDetailTotal(this.$route.query.id)
.then(({ data }) => { .then(({ data }) => {
this.cardData = [ this.cardData = [
{ {
title: '订单总数', title: '订单总数',
value: data.totalCnt, value: data.orderNum
}, },
{ {
title: '订单总额(元)', title: '订单总额(元)',
value: data.tdCnt, value: data.orderFee
}, },
{ {
title: '退款总额(元)', title: '退款总额(元)',
value: data.tdLostCnt, value: data.refundFee
}, },
{ {
title: '净收入(元)', title: '净收入(元)',
value: data.tdNetCnt, value: data.netIncome
}, }
{
title: '昨日发送申请',
value: data.ydNewApplyCnt,
},
] ]
}) })
.catch((e) => { .catch((e) => {})
console.log(e) .finally(() => {})
})
.finally(() => {
this.loading = false
})
},
dealDataFun(res, series, xData) {
xData = res.map((e) => e.xtime)
series.push(res.map((e) => e.addCnt))
series.push(res.map((e) => e.lostCnt))
series.push(res.map((e) => e.lostCnt))
}, },
}, getLineData(data) {
} let val = {
type: 'customization',
startDate: data.beginTime,
endDate: data.endTime,
productId: this.$route.query.id
}
api.getDetailChart(val).then((res) => {
this.xData = res.data.xAxis.data
this.legend = res.data.legend.data
let arr1 = []
let arr2 = []
let arr3 = []
if (res.data.series && res.data.series.length) {
arr1 = res.data.series[0].data
arr2 = res.data.series[1].data
arr3 = res.data.series[2].data
}
this.series = [arr1, arr2, arr3]
})
}
}
}
</script> </script>
<template> <template>
<div> <div>
<el-row :gutter="10" type="flex">
<el-col :span="18">
<CardGroupIndex :data="cardData"></CardGroupIndex> <CardGroupIndex :data="cardData"></CardGroupIndex>
<div class="g-card g-pad20" style="margin-top: 0;">
<div class="g-card g-pad20" style="margin-top: 0">
<div class="title">数据趋势</div> <div class="title">数据趋势</div>
<RemoteDataView <time-search-title @search="getLineData"></time-search-title>
type="lineChart" <chart-line style="height: 300px;" :legend="legend" :xData="xData" :series="series"></chart-line>
:legend="['订单总额(', '退款总额', '净收入']"
:request="api.getTotalCnt"
:dealDataFun="dealDataFun"
></RemoteDataView>
</div> </div>
<div class="g-card g-pad20" style="margin-top: 20px;">
<div class="g-card g-pad20" style="margin-top: 20px">
<div class="title">员工订单Top5</div> <div class="title">员工订单Top5</div>
<RemoteDataView type="table" :request="api.getRankCnt"></RemoteDataView> <el-table v-loading="loading" :data="list" style="width: 100%;">
<el-table-column label="员工" align="center" min-width="100" prop="weUserName" />
<el-table-column label="订单总数" align="center" prop="orderNum" min-width="100"></el-table-column>
<el-table-column label="订单总额(元)" align="center" prop="totalFee" min-width="100"></el-table-column>
</el-table>
</div>
</el-col>
<el-col :span="6" style="min-width: 320px; display: flex; justify-content: space-around;">
<PhoneTemplate>
<div class="phone-content">
<el-image
class="commodity-img commodity-thumb"
style="width: 100%; height: 100px;"
:src="form.picture"
></el-image>
<div class="price">¥{{ form.price }}</div>
<div class="content">{{ form.describe }}</div>
<el-image
v-for="(item, index) in form.attachments"
class="commodity-img"
:src="item"
:key="index"
></el-image>
</div> </div>
</PhoneTemplate>
</el-col>
</el-row>
</div> </div>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.title { .title {
font-size: 16px; font-size: 16px;
color: #333; color: #333;
font-weight: 600; font-weight: 600;
margin-bottom: 20px; margin-bottom: 20px;
} }
.phone-content {
padding: 10px;
}
.price {
font-weight: 500;
font-size: 20px;
margin: 10px 0;
}
.content {
margin: 10px 0;
}
.commodity-img {
width: 100%;
}
</style> </style>
<script> <script>
import * as api from '@/api/commodityCenter/commodityManage' import * as api from '@/api/commodityCenter/commodityManage'
const defaultForm = { const defaultForm = {
picture: '', picture: '',
price: 1, price: 1,
describe: '', describe: '',
attachments: [], attachments: []
} }
export default { export default {
components: {}, components: {},
props: {}, props: {},
data() { data() {
...@@ -16,41 +16,36 @@ export default { ...@@ -16,41 +16,36 @@ export default {
query: { query: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
name: '', name: ''
}, },
// 遮罩层
loading: false, loading: false,
submitLoading: false, submitLoading: false,
dialogVisible: false, dialogVisible: false,
// 表单参数
form: JSON.parse(JSON.stringify(defaultForm)), form: JSON.parse(JSON.stringify(defaultForm)),
// 添加标签输入框
newInput: '', newInput: '',
// 添加标签显隐
newInputVisible: false, newInputVisible: false,
// 表单验证规则
rules: Object.freeze({ rules: Object.freeze({
picture: [{ required: true, message: '必填项', trigger: 'change' }], picture: [{ required: true, message: '必填项', trigger: 'change' }],
price: [{ required: true, message: '必填项', trigger: 'change' }], price: [{ required: true, message: '必填项', trigger: 'change' }],
describe: [{ required: true, message: '必填项', trigger: 'blur' }], describe: [{ required: true, message: '必填项', trigger: 'blur' }]
}), }),
// 选中数组 // 选中数组
ids: [], ids: [],
// 非多个禁用
multiple: true, multiple: true,
// 总条数
total: 0, total: 0,
// 表格数据
list: [], list: [],
lastSyncTime: 0, lastSyncTime: 0
} }
}, },
computed: {}, computed: {},
created() { created() {
// this.query.groupTagType = this.type
this.getList() this.getList()
}, },
methods: { methods: {
resetForm() {
this.query.name = 1
this.getList(1)
},
getList(page) { getList(page) {
page && (this.query.pageNum = page) page && (this.query.pageNum = page)
this.loading = true this.loading = true
...@@ -66,8 +61,13 @@ export default { ...@@ -66,8 +61,13 @@ export default {
this.loading = false this.loading = false
}) })
}, },
edit(data = {}, type) { edit(data) {
this.form = JSON.parse(JSON.stringify(Object.assign(defaultForm, data))) data
? api.getDetail(data.id).then((res) => {
this.form = res.data
this.form.attachments = this.form.attachments.split(',')
})
: (this.form = JSON.parse(JSON.stringify(defaultForm)))
this.dialogVisible = true this.dialogVisible = true
}, },
sync() { sync() {
...@@ -75,7 +75,7 @@ export default { ...@@ -75,7 +75,7 @@ export default {
lock: true, lock: true,
text: 'Loading', text: 'Loading',
spinner: 'el-icon-loading', spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)', background: 'rgba(0, 0, 0, 0.7)'
}) })
api api
.sync() .sync()
...@@ -92,11 +92,13 @@ export default { ...@@ -92,11 +92,13 @@ export default {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
let form = JSON.parse(JSON.stringify(this.form)) let form = JSON.parse(JSON.stringify(this.form))
form.price = form.price.toFixed(2) form.price = form.price.toFixed(2)
form.attachments = form.attachments.join(',')
this.submitLoading = true this.submitLoading = true
api[form.id ? 'update' : 'add'](form) api[form.id ? 'update' : 'add'](form, form.id)
.then(() => { .then(() => {
this.msgSuccess('操作成功') this.msgSuccess('操作成功')
this.dialogVisible = false this.dialogVisible = false
this.getList()
}) })
.finally(() => { .finally(() => {
this.submitLoading = false this.submitLoading = false
...@@ -105,14 +107,14 @@ export default { ...@@ -105,14 +107,14 @@ export default {
}, },
// 多选框选中数据 // 多选框选中数据
handleSelectionChange(selection) { handleSelectionChange(selection) {
this.ids = selection.map((item) => item.groupId) this.ids = selection.map((item) => item.id)
this.multiple = !selection.length this.multiple = !selection.length
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
remove(id) { remove(id) {
const operIds = id || this.ids + '' const operIds = id || this.ids + ''
this.$confirm('是否确认删除吗?', '警告', { this.$confirm('是否确认删除吗?', '警告', {
type: 'warning', type: 'warning'
}) })
.then(function () { .then(function () {
return api.remove(operIds) return api.remove(operIds)
...@@ -126,62 +128,55 @@ export default { ...@@ -126,62 +128,55 @@ export default {
this.$router.push({ this.$router.push({
path: './detail', path: './detail',
query: { query: {
id: row.id, id: row.id
}, }
}) })
}, }
}, }
} }
</script> </script>
<template> <template>
<div class=""> <div class="">
<el-form ref="queryForm" :inline="true" :model="query" label-width="100px" class="top-search"> <el-form ref="queryForm" :inline="true" :model="query" label-width="110px" class="top-search">
<el-form-item label="商品名称" prop="name"> <el-form-item label="商品名称或描述" prop="name">
<el-input v-model="query.name" placeholder="请输入"></el-input> <el-input v-model="query.name" placeholder="请输入"></el-input>
</el-form-item> </el-form-item>
<el-form-item label=" "> <el-form-item label=" ">
<!-- v-hasPermi="['customerManage:customer:query']" -->
<el-button type="primary" @click="getList(1)">查询</el-button> <el-button type="primary" @click="getList(1)">查询</el-button>
<el-button type="success" @click="resetForm()">重置</el-button> <el-button type="success" @click="resetForm()">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<div class="mid-action"> <div class="mid-action">
<!-- v-hasPermi="['customerManage:tag:add']" -->
<el-button type="primary" class="mr10" @click="edit()">新建商品</el-button> <el-button type="primary" class="mr10" @click="edit()">新建商品</el-button>
<!-- v-hasPermi="['customerManage:tag:remove']" -->
<el-button :disabled="!ids.length" type="danger" @click="remove()">批量删除</el-button> <el-button :disabled="!ids.length" type="danger" @click="remove()">批量删除</el-button>
</div> </div>
<el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="list" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="商品" align="center" prop="" width="200">
<el-table-column label="商品" align="center" prop="groupName"> <div slot-scope="{ row }">
<div slot-scope="{ row }" class="toe"> <div style="display: flex;">
<el-image style="width: 50px; height: 50px" :src="row.picture"></el-image> <el-image
<span>{{ row.describe }}}</span> style="width: 50px; height: 50px; margin-right: 3px; flex-shrink: 0;"
:src="row.picture"
></el-image>
<span class="limit_span">{{ row.describe }}</span>
</div>
</div> </div>
</el-table-column> </el-table-column>
<el-table-column label="单价(元)" align="center" prop="price" /> <el-table-column label="单价(元)" align="center" prop="price" />
<el-table-column label="订单总数" align="center" prop="groupName" /> <el-table-column label="订单总数" align="center" prop="orderNum" />
<el-table-column label="订单总额(元)" align="center" prop="groupName" /> <el-table-column label="订单总额(元)" align="center" prop="orderTotalAmount" />
<el-table-column label="创建人" align="center" prop="createBy" /> <el-table-column label="创建人" align="center" prop="createBy" />
<el-table-column label="最近操作时间" align="center" prop="operTime" width="180"> <el-table-column label="最近操作时间" align="center" prop="updateTime" width="180"> </el-table-column>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.operTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="{ row, index }"> <template slot-scope="{ row, index }">
<!-- v-hasPermi="['customerManage:tag:edit']" -->
<el-button type="text" @click="goRoute(row)">详情</el-button> <el-button type="text" @click="goRoute(row)">详情</el-button>
<el-button type="text" @click="edit(row, index)">编辑</el-button> <el-button type="text" @click="edit(row, index)">编辑</el-button>
<el-button type="text" @click="remove(row.id)">删除</el-button> <el-button type="text" @click="remove(row.id)">删除</el-button>
<!-- v-hasPermi="['customerManage:tag:remove']" -->
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total > 0" v-show="total > 0"
:total="total" :total="total"
...@@ -189,7 +184,6 @@ export default { ...@@ -189,7 +184,6 @@ export default {
:limit.sync="query.pageSize" :limit.sync="query.pageSize"
@pagination="getList()" @pagination="getList()"
/> />
<!-- 弹窗 --> <!-- 弹窗 -->
<el-dialog <el-dialog
:title="form.id ? '修改' : '新建'" :title="form.id ? '修改' : '新建'"
...@@ -206,16 +200,10 @@ export default { ...@@ -206,16 +200,10 @@ export default {
</upload> </upload>
</el-form-item> </el-form-item>
<el-form-item label="商品单价(元)" prop="price"> <el-form-item label="商品单价(元)" prop="price">
<el-input-number <el-input-number v-model="form.price" :precision="2" :step="0.1" :min="0" :max="50000"></el-input-number>
v-model="form.price"
:precision="2"
:step="0.1"
:min="0"
:max="50000"
></el-input-number>
<div class="tip">精确到小数点后两位,不超过5万元</div> <div class="tip">精确到小数点后两位,不超过5万元</div>
</el-form-item> </el-form-item>
<el-form-item label="商品描述" prop="describe"> <el-form-item label="商品标题或描述" prop="describe">
<el-input <el-input
v-model="form.describe" v-model="form.describe"
type="textarea" type="textarea"
...@@ -225,9 +213,8 @@ export default { ...@@ -225,9 +213,8 @@ export default {
placeholder="请输入" placeholder="请输入"
></el-input> ></el-input>
</el-form-item> </el-form-item>
<el-form-item label="商品详情"> <el-form-item label="商品详情">
<upload :fileUrl.sync="form.attachments" type="0"> <upload :fileUrls.sync="form.attachments" :limit="8" type="0">
<div slot="tip" class="tip">最多添加八张详情</div> <div slot="tip" class="tip">最多添加八张详情</div>
</upload> </upload>
</el-form-item> </el-form-item>
...@@ -238,15 +225,15 @@ export default { ...@@ -238,15 +225,15 @@ export default {
<div class="phone-content"> <div class="phone-content">
<el-image <el-image
class="commodity-img commodity-thumb" class="commodity-img commodity-thumb"
style="width: 100%; height: 50px" style="width: 100%; height: 100px;"
:src="form.picture" :src="form.picture"
></el-image> ></el-image>
<div class="price">¥{{ form.price.toFixed(2) }}</div> <div class="price">¥{{ form.price }}</div>
<div class="content">{{ form.describe }}</div> <div class="content">{{ form.describe }}</div>
<el-image <el-image
v-for="(item, index) of form.attachments" v-for="(item, index) in form.attachments"
class="commodity-img" class="commodity-img"
:src="item.picURL" :src="item"
:key="index" :key="index"
></el-image> ></el-image>
</div> </div>
...@@ -261,20 +248,37 @@ export default { ...@@ -261,20 +248,37 @@ export default {
</div> </div>
</template> </template>
<style lang="scss" scoped> <style lang="scss" scoped>
.tip { .tip {
color: #aaa; color: #aaa;
font-size: 12px; font-size: 12px;
line-height: 20px; line-height: 20px;
} }
.phone-content { .phone-content {
padding: 10px; padding: 10px;
} }
.price { .price {
font-weight: 500; font-weight: 500;
font-size: 20px; font-size: 20px;
margin: 10px 0; margin: 10px 0;
} }
.commodity-img { .content {
margin: 10px 0;
}
.commodity-img {
width: 100%; width: 100%;
} }
.limit_span {
// width: 250px;
// overflow: hidden;
// text-overflow: ellipsis;
// // white-space: nowrap;
// display: inline-block;
white-space: pre-wrap;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
</style> </style>
<script>
import * as api from '@/api/commodityCenter/commodityManage'
export default {
components: {},
props: {},
data() {
return {
query: {
pageNum: 1,
pageSize: 10,
name: ''
},
loading: false,
dialogVisible: false,
total: 0,
list: [],
lastSyncTime: 0
}
},
computed: {},
created() {
this.getList()
},
methods: {
resetForm() {
this.query.name = 1
this.getList(1)
},
getList(page) {
page && (this.query.pageNum = page)
this.loading = true
api
.getList(this.query)
.then(({ rows, total, lastSyncTime }) => {
this.list = rows
this.total = +total
this.lastSyncTime = lastSyncTime
this.loading = false
})
.catch(() => {
this.loading = false
})
},
sync() {
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
})
api
.sync()
.then(() => {
loading.close()
this.msgSuccess('后台开始同步数据,请稍后关注进度')
this.getList()
})
.catch(() => {
loading.close()
})
},
goRoute(row) {
this.$router.push({
path: './detail',
query: {
id: row.id
}
})
}
}
}
</script>
<template>
<div class="">
<el-form ref="queryForm" :inline="true" :model="query" label-width="110px" class="top-search">
<el-form-item label="商品名称或描述" prop="name">
<el-input v-model="query.name" placeholder="请输入"></el-input>
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" @click="getList(1)">查询</el-button>
<el-button type="success" @click="resetForm()">重置</el-button>
</el-form-item>
</el-form>
<div class="mid-action">
<el-button type="primary" class="mr10" @click="sync()">同步订单</el-button>
<el-button :disabled="!ids.length" type="danger">导出Excel</el-button>
</div>
<el-table v-loading="loading" :data="list">
<el-table-column label="商品" align="center" prop="" width="200">
<div slot-scope="{ row }">
<div style="display: flex;">
<el-image
style="width: 50px; height: 50px; margin-right: 3px; flex-shrink: 0;"
:src="row.picture"
></el-image>
<span class="limit_span">{{ row.describe }}</span>
</div>
</div>
</el-table-column>
<el-table-column label="单价(元)" align="center" prop="price" />
<el-table-column label="订单总数" align="center" prop="orderNum" />
<el-table-column label="订单总额(元)" align="center" prop="orderTotalAmount" />
<el-table-column label="创建人" align="center" prop="createBy" />
<el-table-column label="最近操作时间" align="center" prop="updateTime" width="180"> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="{ row, index }">
<!-- <el-button type="text" @click="goRoute(row)">详情</el-button>
<el-button type="text" @click="edit(row, index)">编辑</el-button> -->
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="query.pageNum"
:limit.sync="query.pageSize"
@pagination="getList()"
/>
<!-- 弹窗 -->
<el-dialog
:title="form.id ? '修改' : '新建'"
:visible.sync="dialogVisible"
width="800px"
:close-on-click-modal="false"
>
<el-row>
<el-col :span="12">
<el-form ref="form" :model="form" :rules="rules" label-width="100px"> </el-form>
</el-col>
</el-row>
<div slot="footer" class="dialog-footer ar">
<el-button type="primary" v-loading="submitLoading" @click="submit">确 定</el-button>
<el-button @click="dialogVisible = false">取 消</el-button>
</div>
</el-dialog>
</div>
</template>
<style lang="scss" scoped>
.tip {
color: #aaa;
font-size: 12px;
line-height: 20px;
}
.phone-content {
padding: 10px;
}
.price {
font-weight: 500;
font-size: 20px;
margin: 10px 0;
}
.content {
margin: 10px 0;
}
.commodity-img {
width: 100%;
}
.limit_span {
// width: 250px;
// overflow: hidden;
// text-overflow: ellipsis;
// // white-space: nowrap;
// display: inline-block;
white-space: pre-wrap;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
</style>
<script>
import CardGroupIndex from '@/components/CardGroupIndex'
import TimeSearchTitle from '@/components/common/TimeSearchTitle'
import ChartLine from '@/components/ChartLine.vue'
import * as api from '@/api/commodityCenter/commodityManage'
export default {
name: '',
components: { TimeSearchTitle, CardGroupIndex, ChartLine },
data() {
return {
loading: false,
list: [],
legend: ['订单总额', '退款总额', '净收入'],
xData: [],
series: [],
cardData: [],
active: 0,
api
}
},
computed: {},
watch: {},
created() {
this.getList()
this.getTop5Fn()
},
mounted() {},
methods: {
getTop5Fn() {
this.loading = true
api.getDetailTable(this.$route.query.id).then((res) => {
if (res.code === 200) {
this.list = res.data
}
this.loading = false
})
},
getList() {
this.loading = true
api
.getDetailTotal(this.$route.query.id)
.then(({ data }) => {
this.cardData = [
{
title: '订单总数',
value: data.orderNum
},
{
title: '订单总额(元)',
value: data.orderFee
},
{
title: '退款总额(元)',
value: data.refundFee
},
{
title: '净收入(元)',
value: data.netIncome
}
]
})
.catch((e) => {})
.finally(() => {})
},
getLineData(data) {
let val = {
type: 'customization',
startDate: data.beginTime,
endDate: data.endTime,
productId: this.$route.query.id
}
api.getDetailChart(val).then((res) => {
this.xData = res.data.xAxis.data
this.legend = res.data.legend.data
let arr1 = []
let arr2 = []
let arr3 = []
if (res.data.series && res.data.series.length) {
arr1 = res.data.series[0].data
arr2 = res.data.series[1].data
arr3 = res.data.series[2].data
}
this.series = [arr1, arr2, arr3]
})
}
}
}
</script>
<template>
<div>
<CardGroupIndex :data="cardData"></CardGroupIndex>
<div class="g-card g-pad20" style="margin-top: 0;">
<div class="title">数据趋势</div>
<time-search-title @search="getLineData"></time-search-title>
<chart-line style="height: 300px;" :legend="legend" :xData="xData" :series="series"></chart-line>
</div>
<div class="g-card g-pad20" style="margin-top: 20px;">
<div class="title">员工订单Top5</div>
<el-table v-loading="loading" :data="list" style="width: 100%;">
<el-table-column label="员工" align="center" min-width="100" prop="weUserName" />
<el-table-column label="订单总数" align="center" prop="orderNum" min-width="100"></el-table-column>
<el-table-column label="订单总额(元)" align="center" prop="totalFee" min-width="100"></el-table-column>
</el-table>
</div>
</div>
</template>
<style lang="scss" scoped>
.title {
font-size: 16px;
color: #333;
font-weight: 600;
margin-bottom: 20px;
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!