前端
This commit is contained in:
parent
d3e075aa58
commit
2538e6116b
@ -7,6 +7,7 @@ use App\Core\Service;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use App\Exceptions\NotAllowedException;
|
||||
use App\Domains\Virtual\Services\CommonService;
|
||||
use App\Domains\Virtual\Services\PackageService;
|
||||
use App\Domains\Virtual\Repositories\OrderRepository;
|
||||
use App\Domains\Virtual\Repositories\CompanyRepository;
|
||||
use App\Domains\Virtual\Repositories\PackageRepository;
|
||||
@ -110,7 +111,16 @@ class OrderService extends Service
|
||||
|
||||
$cards = $repository->withConditions($conditions)->applyConditions()->paginate($conditions['limit']);
|
||||
|
||||
return self::detailTransformer($cards);
|
||||
$cards = self::detailTransformer($cards);
|
||||
|
||||
if (in_array($conditions['type'], [2, 3])) {
|
||||
$basePackages = app(OrderCardPartitionRepository::class)->getCardBasePackages($cards->pluck('sim')->toArray())->keyBy('sim')->toArray();
|
||||
$cards->map(function ($item) use ($basePackages) {
|
||||
$item->base_package_name = PackageService::load($basePackages[$item['sim']]['package_id'])['name'];
|
||||
});
|
||||
}
|
||||
|
||||
return $cards;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,5 +1,12 @@
|
||||
<template>
|
||||
<Modal :footer-hide="true" :mask-closable="false" @on-visible-change="visibleChange" title="详情" v-model="my_show" width="1200">
|
||||
<Modal
|
||||
:footer-hide="true"
|
||||
:mask-closable="false"
|
||||
@on-visible-change="visibleChange"
|
||||
title="详情"
|
||||
v-model="my_show"
|
||||
width="1200"
|
||||
>
|
||||
<div class="page-detail-wrap">
|
||||
<ui-loading :show="page_loading.show"></ui-loading>
|
||||
|
||||
@ -22,11 +29,23 @@
|
||||
</ul>
|
||||
|
||||
<div class="page-list-wrap">
|
||||
<Table :columns="columns" :data="list_data ? list_data.data : []" stripe width="1150"></Table>
|
||||
<Table
|
||||
:columns="(options.type == 2 || options.type == 3) ? columns2 : columns"
|
||||
:data="list_data ? list_data.data : []"
|
||||
stripe
|
||||
width="1150"
|
||||
></Table>
|
||||
</div>
|
||||
|
||||
<div class="page-turn-wrap" v-if="list_data">
|
||||
<Page :current="Number(list_data.current_page)" :page-size="Number(list_data.per_page)" :total="Number(list_data.total)" @on-change="index" show-elevator show-total></Page>
|
||||
<Page
|
||||
:current="Number(list_data.current_page)"
|
||||
:page-size="Number(list_data.per_page)"
|
||||
:total="Number(list_data.total)"
|
||||
@on-change="index"
|
||||
show-elevator
|
||||
show-total
|
||||
></Page>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,5 +1,5 @@
|
||||
export default {
|
||||
name: 'StatsOrderDetail',
|
||||
name: "StatsOrderDetail",
|
||||
props: {
|
||||
show: {
|
||||
type: Boolean,
|
||||
@ -10,8 +10,8 @@ export default {
|
||||
default: {
|
||||
type: null,
|
||||
order_id: null,
|
||||
orderBy: 'id',
|
||||
sortedBy: 'asc'
|
||||
orderBy: "id",
|
||||
sortedBy: "asc"
|
||||
}
|
||||
},
|
||||
list: {
|
||||
@ -28,55 +28,71 @@ export default {
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
my_show: false,
|
||||
list_data: null,
|
||||
columns: [{
|
||||
title: 'SIM',
|
||||
key: 'sim',
|
||||
var columns = [
|
||||
{
|
||||
title: "SIM",
|
||||
key: "sim",
|
||||
width: 150
|
||||
},
|
||||
{
|
||||
title: '企业名称',
|
||||
key: 'company_name',
|
||||
title: "企业名称",
|
||||
key: "company_name",
|
||||
width: 300
|
||||
},
|
||||
{
|
||||
title: '套餐名称',
|
||||
key: 'package_name',
|
||||
title: "套餐名称",
|
||||
key: "package_name",
|
||||
width: 150
|
||||
},
|
||||
{
|
||||
title: '套餐周期',
|
||||
key: 'service_months',
|
||||
title: "套餐周期",
|
||||
key: "service_months",
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '支付方式',
|
||||
key: 'pay_channel_name',
|
||||
title: "支付方式",
|
||||
key: "pay_channel_name",
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '价格',
|
||||
key: 'unit_price',
|
||||
title: "价格",
|
||||
key: "unit_price",
|
||||
width: 120
|
||||
},
|
||||
{
|
||||
title: '数量',
|
||||
key: 'counts',
|
||||
title: "数量",
|
||||
key: "counts",
|
||||
width: 75
|
||||
},
|
||||
{
|
||||
title: '订单时间',
|
||||
key: 'order_at',
|
||||
title: "订单时间",
|
||||
key: "order_at",
|
||||
width: 170
|
||||
}
|
||||
]
|
||||
];
|
||||
|
||||
var columns2 = JSON.parse(JSON.stringify(columns));
|
||||
|
||||
columns2.splice(2, 0, {
|
||||
title: "基本套餐",
|
||||
key: "base_package_name",
|
||||
width: 150
|
||||
});
|
||||
|
||||
console.log(columns2);
|
||||
|
||||
var data = {
|
||||
my_show: false,
|
||||
list_data: null,
|
||||
columns: columns,
|
||||
columns2: columns2
|
||||
};
|
||||
|
||||
return data;
|
||||
},
|
||||
methods: {
|
||||
visibleChange(bool) {
|
||||
this.$emit('update:show', bool);
|
||||
this.$emit("update:show", bool);
|
||||
},
|
||||
/**
|
||||
* [index 列表]
|
||||
@ -88,35 +104,42 @@ export default {
|
||||
let params = this.options;
|
||||
params.page = page;
|
||||
|
||||
service.get('api/stats/order/detail', { params }).then(res => {
|
||||
this.isShowLoading(false);
|
||||
if (res.code == 0) {
|
||||
this.list_data = res.data;
|
||||
}
|
||||
}).catch(() => {
|
||||
this.isShowLoading(false);
|
||||
});
|
||||
service
|
||||
.get("api/stats/order/detail", { params })
|
||||
.then(res => {
|
||||
this.isShowLoading(false);
|
||||
if (res.code == 0) {
|
||||
this.list_data = res.data;
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
this.isShowLoading(false);
|
||||
});
|
||||
},
|
||||
exportExcel() {
|
||||
this.isShowLoading(true);
|
||||
let params = this.options;
|
||||
|
||||
service.get('api/stats/order/detail/export', { params }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
if (res.data) {
|
||||
this.downloadFile(res.data);
|
||||
} else {
|
||||
this.$Modal.success({
|
||||
title: '提示',
|
||||
content: '当前导出数据量大,已进入后台队列导出模式,请稍后至导出列表查看下载。'
|
||||
});
|
||||
service
|
||||
.get("api/stats/order/detail/export", { params })
|
||||
.then(res => {
|
||||
if (res.code === 0) {
|
||||
if (res.data) {
|
||||
this.downloadFile(res.data);
|
||||
} else {
|
||||
this.$Modal.success({
|
||||
title: "提示",
|
||||
content:
|
||||
"当前导出数据量大,已进入后台队列导出模式,请稍后至导出列表查看下载。"
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.isShowLoading(false);
|
||||
}).catch(() => {
|
||||
this.isShowLoading(false);
|
||||
});
|
||||
this.isShowLoading(false);
|
||||
})
|
||||
.catch(() => {
|
||||
this.isShowLoading(false);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
1
public/js/app.6341a938.js
Normal file
1
public/js/app.6341a938.js
Normal file
File diff suppressed because one or more lines are too long
14
public/js/chunk-05d31f73.ae07cb0c.js
Normal file
14
public/js/chunk-05d31f73.ae07cb0c.js
Normal file
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
<!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=\favicon.ico><script src=\config.js></script><title></title><link href=/css/chunk-05d31f73.1ad3b9ab.css rel=prefetch><link href=/css/chunk-6ea47298.6166dab5.css rel=prefetch><link href=/js/chunk-00ae0766.d130b440.js rel=prefetch><link href=/js/chunk-05d31f73.bd1096f5.js rel=prefetch><link href=/js/chunk-07a274ec.55e1b3b0.js rel=prefetch><link href=/js/chunk-6ea47298.b6a301d0.js rel=prefetch><link href=/css/app.be09e36f.css rel=preload as=style><link href=/css/chunk-vendors.3c3b2e85.css rel=preload as=style><link href=/js/app.943d332c.js rel=preload as=script><link href=/js/chunk-vendors.f1169dcc.js rel=preload as=script><link href=/css/chunk-vendors.3c3b2e85.css rel=stylesheet><link href=/css/app.be09e36f.css rel=stylesheet></head><body><noscript><strong>很抱歉,如果没有启用JavaScript,程序不能正常工作,若要继续使用请启用它。</strong></noscript><div id=app></div><script src=/js/chunk-vendors.f1169dcc.js></script><script src=/js/app.943d332c.js></script></body></html>
|
||||
<!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><link rel=icon href=\favicon.ico><script src=\config.js></script><title></title><link href=/css/chunk-05d31f73.1ad3b9ab.css rel=prefetch><link href=/css/chunk-6ea47298.6166dab5.css rel=prefetch><link href=/js/chunk-00ae0766.d130b440.js rel=prefetch><link href=/js/chunk-05d31f73.ae07cb0c.js rel=prefetch><link href=/js/chunk-07a274ec.55e1b3b0.js rel=prefetch><link href=/js/chunk-6ea47298.b6a301d0.js rel=prefetch><link href=/css/app.be09e36f.css rel=preload as=style><link href=/css/chunk-vendors.3c3b2e85.css rel=preload as=style><link href=/js/app.6341a938.js rel=preload as=script><link href=/js/chunk-vendors.f1169dcc.js rel=preload as=script><link href=/css/chunk-vendors.3c3b2e85.css rel=stylesheet><link href=/css/app.be09e36f.css rel=stylesheet></head><body><noscript><strong>很抱歉,如果没有启用JavaScript,程序不能正常工作,若要继续使用请启用它。</strong></noscript><div id=app></div><script src=/js/chunk-vendors.f1169dcc.js></script><script src=/js/app.6341a938.js></script></body></html>
|
Loading…
x
Reference in New Issue
Block a user